Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- P: &7[&4&lKingdom &6&lUHC&7]
- command /playerswap [<text>]:
- permission: skript.op
- trigger:
- if arg 1 is not set:
- message "{@P} &e/playerswap enable &8» &7Starts the Timer!" to command sender
- message "{@P} &e/playerswap disable &8» &7Stops the Timer!" to command sender
- message "{@P} &e/pstime &8» &7Time before next swap!" to command sender
- if arg 1 is "enable":
- if {playerswap} is not set:
- set {playerswap} to true
- set {timeswap} to 600
- broadcast "{@P} &7Player Swap&8: &eEnabled"
- else:
- if {playerswap} is true:
- message "{@P} &7Player Swap&8: &eAlready Enabled!"
- if arg 1 is "disable":
- if {playerswap} is true:
- delete {playerswap}
- delete {timeswap}
- broadcast "{@P} &7Player Swap&8: &cDisabled"
- else:
- if {playerswap} is not set:
- message "{@P} &7Player Swap&8: &cAlready Disabled!"
- command /pstime:
- trigger:
- message "{@P} There are &e%{timeswap}% &7seconds left before the next Swap!" to command sender
- every second:
- if {playerswap} is true:
- subtract 1 from {timeswap}
- every second:
- if {playerswap} is true:
- if {timeswap} is less than 1:
- set {timeswap} to 600
- delete {playertp::*}
- loop all players:
- if {spec::%loop-player%} is not set:
- if loop-player is not "Pheo":
- add loop-player to {playertp::*}
- set {_swapp1} to (random element out of {playertp::*})
- remove {_swapp1} from {playertp::*}
- set {_x} to {_swapp1}'s x-coordinate
- set {_y} to {_swapp1}'s y-coordinate
- set {_z} to {_swapp1}'s z-coordinate
- set {_world} to {_swapp1}'s world
- set {playerloc.%{_swapp1}%} to (the location at {_x}, {_y}, {_z} of the world {_world})
- wait 1 tick
- set {_swapp2} to (random element out of {playertp::*})
- remove {_swapp2} from {playertp::*}
- set {_x2} to {_swapp2}'s x-coordinate
- set {_y2} to {_swapp2}'s y-coordinate
- set {_z2} to {_swapp2}'s z-coordinate
- set {_world2} to {_swapp2}'s world
- set {playerloc.%{_swapp2}%} to (the location at {_x2}, {_y2}, {_z2} of the world {_world2})
- wait 1 tick
- teleport {_swapp2} to {playerloc.%{_swapp1}%}
- teleport {_swapp1} to {playerloc.%{_swapp2}%}
- broadcast "{@P} &e%{_swapp1}% &7has been swapped with &e%{_swapp2}%&7!"
- wait 1 tick
- delete {_swapp2}
- delete {_swapp1}
- delete {playerloc.%{_swapp2}%}
- delete {playerloc.%{_swapp1}%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement