Advertisement
Tarna256

queue

Jul 8th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. command /queue <text>:
  2. trigger:
  3. if arg-1 is "join":
  4. if {queue::*} contains player:
  5. send "&cYou are already in the queue" # says this if the player is already in the queue
  6. else:
  7. add player to {queue::*}
  8. send "&eJoined the Queue" # joins the queue of the player is not part of it
  9. if size of {queue::*} is 2:
  10. teleport {queue::1} to {loc1} # teleports first element of queue to {loc1}
  11. delete {queue::1} # deletes the first element of the queue
  12. teleport {queue::1} to {loc2} # teleports the new first element of queue to {loc2}
  13. delete {queue::1} # deletes the new first element of the queue
  14. else if arg-1 is "leave":
  15. if {queue::*} contains player:
  16. remove player from {queue::*}
  17. send "&eLeft the Queue" #leaves the queue of the player is part of it
  18. else:
  19. send "&cYou are not in the queue" # says this if the player attempts to leave the queue but is not part of it
  20. else if arg-1 is "list":
  21. send "&cPlayers in queue: &f%{queue::*}%" # shows the list of players in the queue
  22. else if arg-1 is "clear":
  23. if player has permission "queue.clear":
  24. clear {queue::*} # clears the queue
  25. else if arg-1 is "setloc1":
  26. if player has permission "queue.setlocation":
  27. set {loc1} to player's location # sets the first location to where players of queue get teleported
  28. else if arg-1 is "setloc2":
  29. if player has permission "queue.setlocation":
  30. set {loc2} to player's location # sets the second location to where players of queue get teleported
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement