Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 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 gamemode of player is not spectator:
  35. if {playerswap} is true:
  36. if {timeswap} is less than 1:
  37. set {timeswap} to 600
  38. delete {playertp::*}
  39. loop all players:
  40. if {spec::%loop-player%} is not set:
  41. if loop-player is not "Pheo":
  42. add loop-player to {playertp::*}
  43. set {_swapp1} to (random element out of {playertp::*})
  44. remove {_swapp1} from {playertp::*}
  45. set {_x} to {_swapp1}'s x-coordinate
  46. set {_y} to {_swapp1}'s y-coordinate
  47. set {_z} to {_swapp1}'s z-coordinate
  48. set {_world} to {_swapp1}'s world
  49. set {playerloc.%{_swapp1}%} to (the location at {_x}, {_y}, {_z} of the world {_world})
  50. wait 1 tick
  51. set {_swapp2} to (random element out of {playertp::*})
  52. remove {_swapp2} from {playertp::*}
  53. set {_x2} to {_swapp2}'s x-coordinate
  54. set {_y2} to {_swapp2}'s y-coordinate
  55. set {_z2} to {_swapp2}'s z-coordinate
  56. set {_world2} to {_swapp2}'s world
  57. set {playerloc.%{_swapp2}%} to (the location at {_x2}, {_y2}, {_z2} of the world {_world2})
  58. wait 1 tick
  59. teleport {_swapp2} to {playerloc.%{_swapp1}%}
  60. teleport {_swapp1} to {playerloc.%{_swapp2}%}
  61. broadcast "{@P} &e%{_swapp1}% &7has been swapped with &e%{_swapp2}%&7!"
  62. wait 1 tick
  63. delete {_swapp2}
  64. delete {_swapp1}
  65. delete {playerloc.%{_swapp2}%}
  66. delete {playerloc.%{_swapp1}%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement