Help with making a randomtp thing

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

TubeVillager

Member
Jan 29, 2019
28
1
0
23
Hey people im back

i am making a skript that lets you do /randomtp and it will teleport you to a random player but i want it that it can not teleport you to yourself

second of all i want it to be like if you are the only player online it will tell you that there is nobody to teleport to.
so how do i do this?
 
you can remove the player who executed the commands from a list variable which has all players, and then check if that list is set
 
Code:
command /randomtp:
    trigger:
        set {_l::*} to all players
        if size of {_l::*} <= 1:
            message "There is no one to teleport to."
            stop
        remove player from {_l::*}
        teleport player to a random element out of {_l::*}
 
okay ive done this


command /randomtp:
executable by: players
trigger:
set {_l::*} to all players
if size of {_l::*} <= 1:
message "{@Prefix} {@Randomtp No Player Message}" to player
stop
remove player from {_l::*}
teleport player to a random element out of {_l::*}
send "{@Prefix} {@Randomtp Successfull Message}" to player

but now when i type /randomtp nothing happens anymore.
nothing with 1 player online nothing with 2 players online.
just noting...
 
Status
Not open for further replies.