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!


    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

    Jul 29, 2020
    Likes Received:
    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
    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%}
    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

    Jul 25, 2019
    Likes Received:
    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


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

Share This Page