Variables with all players who have ever joined?

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Yochran

Member
Jul 29, 2020
1
0
0
17
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:
command /resetserverkillpoints [<text>]:
    aliases: rskp
    trigger:
        if executor does not have permission "yochranstaffcore.management":
            message "&fUnknown command. Type '/help' for help."
        else:
            message "&aAre you sure you want to do this?"
            message "&aType &2Yes &aor &cNo &ain chat to confirm."
            set {rskp.%uuid of player%} to true

on chat:
    if {rskp.%uuid of player%} is true:
        if "%message%" contains "No":
            cancel event
            message "&aYou cancelled resetting the server's killpoints."
            delete {rskp.%uuid of player%}
        else:
            if "%message%" contains "Yes":
                cancel event
                message "&aYou have reset the server's killpoints."
                loop all players:
                    set {total-killpoints::*} to 0
                    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.
 
Last edited:
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.
 
Status
Not open for further replies.