Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. options:
  2. P: &7[&4&lKingdom &6&lUHC&7]
  3.  
  4. command /playerswap [<text>]:
  5. permission: skript.op
  6. trigger:
  7. if arg 1 is not set:
  8. message "{@P} &e/playerswap enable &8» &7Starts the Timer!" to command sender
  9. message "{@P} &e/playerswap disable &8» &7Stops the Timer!" to command sender
  10. message "{@P} &e/pstime &8» &7Time before next swap!" to command sender
  11. if arg 1 is "enable":
  12. if {playerswap} is not set:
  13. set {playerswap} to true
  14. set {timeswap} to 600
  15. broadcast "{@P} &7Player Swap&8: &eEnabled"
  16. else:
  17. if {playerswap} is true:
  18. message "{@P} &7Player Swap&8: &eAlready Enabled!"
  19. if arg 1 is "disable":
  20. if {playerswap} is true:
  21. delete {playerswap}
  22. delete {timeswap}
  23. broadcast "{@P} &7Player Swap&8: &cDisabled"
  24. else:
  25. if {playerswap} is not set:
  26. message "{@P} &7Player Swap&8: &cAlready Disabled!"
  27. command /pstime:
  28. trigger:
  29. message "{@P} There are &e%{timeswap}% &7seconds left before the next Swap!" to command sender
  30. every second:
  31. if {playerswap} is true:
  32. subtract 1 from {timeswap}
  33. every second:
  34. if {playerswap} is true:
  35. if {timeswap} is less than 1:
  36. set {timeswap} to 600
  37. delete {playertp::*}
  38. loop all players:
  39. if {spec::%loop-player%} is not set:
  40. if loop-player is not "Pheo":
  41. add loop-player to {playertp::*}
  42. set {_swapp1} to (random element out of {playertp::*})
  43. remove {_swapp1} from {playertp::*}
  44. set {_x} to {_swapp1}'s x-coordinate
  45. set {_y} to {_swapp1}'s y-coordinate
  46. set {_z} to {_swapp1}'s z-coordinate
  47. set {_world} to {_swapp1}'s world
  48. set {playerloc.%{_swapp1}%} to (the location at {_x}, {_y}, {_z} of the world {_world})
  49. wait 1 tick
  50. set {_swapp2} to (random element out of {playertp::*})
  51. remove {_swapp2} from {playertp::*}
  52. set {_x2} to {_swapp2}'s x-coordinate
  53. set {_y2} to {_swapp2}'s y-coordinate
  54. set {_z2} to {_swapp2}'s z-coordinate
  55. set {_world2} to {_swapp2}'s world
  56. set {playerloc.%{_swapp2}%} to (the location at {_x2}, {_y2}, {_z2} of the world {_world2})
  57. wait 1 tick
  58. teleport {_swapp2} to {playerloc.%{_swapp1}%}
  59. teleport {_swapp1} to {playerloc.%{_swapp2}%}
  60. broadcast "{@P} &e%{_swapp1}% &7has been swapped with &e%{_swapp2}%&7!"
  61. wait 1 tick
  62. delete {_swapp2}
  63. delete {_swapp1}
  64. delete {playerloc.%{_swapp2}%}
  65. delete {playerloc.%{_swapp1}%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement