1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Variables with all players who have ever joined?

Discussion in 'Skript' started by Yochran, Jul 29, 2020.

Thread Status:
Not open for further replies.
  1. Yochran

    Yochran Member

    Joined:
    Jul 29, 2020
    Messages:
    1
    Likes Received:
    0
    Hey, so for my SoupPvP server I made the "currency" called KillPoints, when you kill a player you get one and when you die you lose one.

    Basically I'm trying to make a command to reset the server's killpoints for when I do stat resets, and I cant figure out how to get all players who have ever joined in a variable. This is what I have so far:


    Code (Text):
    1. command /resetserverkillpoints [<text>]:
    2.     aliases: rskp
    3.     trigger:
    4.         if executor does not have permission "yochranstaffcore.management":
    5.             message "&fUnknown command. Type '/help' for help."
    6.         else:
    7.             message "&aAre you sure you want to do this?"
    8.             message "&aType &2Yes &aor &cNo &ain chat to confirm."
    9.             set {rskp.%uuid of player%} to true
    10.  
    11. on chat:
    12.     if {rskp.%uuid of player%} is true:
    13.         if "%message%" contains "No":
    14.             cancel event
    15.             message "&aYou cancelled resetting the server's killpoints."
    16.             delete {rskp.%uuid of player%}
    17.         else:
    18.             if "%message%" contains "Yes":
    19.                 cancel event
    20.                 message "&aYou have reset the server's killpoints."
    21.                 loop all players:
    22.                     set {total-killpoints::*} to 0
    23.                     delete {rskp.%uuid of loop-player-1%}
    24.  
    Basically for the on chat: thing, I'm trying to make it so that when you type "yes" it sets the killpoints of all players who ever joined to 0. Whenever I run the command and type "yes," it doesnt reset anyone's killpoints. Ive tried many things like {total-killpoints.%uuid of all offline players%}, none of it seems to work. Please help.
     
    #1 Yochran, Jul 29, 2020
    Last edited: Jul 29, 2020
  2. IDuckz_

    IDuckz_ Active Member

    Joined:
    Jul 25, 2019
    Messages:
    106
    Likes Received:
    2
    This is why you should not use dots in variables and use :: instead because you can loop the variable or reset it, once you have done {rskp::%uuid of player%} you can do "delete {rskp::*}" which will delete that variable meaning it will reset everyone's stats.
     
  3. Runakai

    Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    %all offline players%
     
Thread Status:
Not open for further replies.

Share This Page

Loading...