Zeldaboy111

Particles ]|[ Skript #453

Sep 22nd, 2021
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.10 KB | None | 0 0
  1. options:
  2. prefix: &6Mines&8:&7
  3.  
  4. on quit:
  5. delete {mine.user.%uuid of player%.isConfirmingMine}
  6. delete {mine.user.%uuid of player%.isShowingMine}
  7.  
  8. command /mine [<text>] [<text>] [<text>] [<text>] [<text>]:
  9. aliases: /mines
  10. trigger:
  11. if executor is not a player:
  12. send "{@prefix} This command can only be executed by a player."
  13. else if arg-1 is "create":
  14. if arg-2 is not set:
  15. send "{@prefix} Invalid Usage! &e/mine create <id> <length> <depth> <width>&7."
  16. else if {mine.list::*} contains arg-2 in lower case:
  17. send "{@prefix} A mine with the id &e%arg-2 in lower case% &7already exists."
  18. else if isNotANumber(player, arg-3, "<length>", "<depth>", "<width>"), isNotANumber(player, arg-4, arg-3, "<depth>", "<width>") or isNotANumber(player, arg-5, arg-3, arg-4, "<width>") is false:
  19. stop
  20. else:
  21. set {mine.user.%uuid of player%.isConfirmingMine} to true
  22. set {mine.user.%uuid of player%.location} to location of block at location of player
  23. set {mine.user.%uuid of player%.id} to arg-2 in lower case
  24. set {mine.user.%uuid of player%.length} to arg-3 parsed as an integer
  25. set {mine.user.%uuid of player%.depth} to arg-4 parsed as an integer
  26. set {mine.user.%uuid of player%.width} to arg-5 parsed as an integer
  27. showMineToConfirm(player)
  28. send "{@prefix} Please confirm you want to create a mine with as parameters &e%arg-3% &e%arg-4% &e%arg-5%&7."
  29. send "{@prefix} To confirm, please type &e/mine <confirm | cancel>&7."
  30.  
  31. else if arg-1 is "delete":
  32. # Delete a mine
  33. else if arg-1 is "confirm":
  34. if {mine.user.%uuid of player%.isConfirmingMine} is not true:
  35. send "{@prefix} Invalid Usage! &e/mine <create | delete> <id> <length> <depth> <width>&7."
  36. else:
  37. if {mine.list::*} contains {mine.user.%uuid of player%.id}:
  38. send "{@prefix} A mine with the id &e%arg-2 in lower case% &7already exists."
  39. delete {mine.user.%uuid of player%.isConfirmingMine}
  40. else:
  41.  
  42. # Confirm creating a mine
  43. else if arg-1 is "cancel":
  44. if {mine.user.%uuid of player%.isConfirmingMine} is not true:
  45. send "{@prefix} Invalid Usage! &e/mine <create | delete> <id> <length> <depth> <width>&7."
  46. else:
  47. delete {mine.user.%uuid of player%.isConfirmingMine}
  48. send "{@prefix} You have cancelled creating the mine."
  49. else:
  50. send "{@prefix} Invalid Usage! &e/mine <create | delete> <id> <length> <depth> <width>&7."
  51.  
  52. function isNotANumber(player: Player, input: String, length: String, depth: String, width: String) :: Boolean:
  53. if {_input} parsed as an integer is not set:
  54. send "{@prefix} Invalid Usage! &e/mine create <id> %{_length}% &e%{_depth}% &e%{_width}%&7." to {_player}
  55. return false
  56. return true
  57.  
  58. function showMineToConfirm(player: Player):
  59. set {_uuid} to uuid of {_player}
  60. if {mine.user.%{_uuid}%.isShowingMine} is true:
  61. stop
  62. set {mine.user.%{_uuid}%.isShowingMine} to true
  63. while {mine.user.%{_uuid}%.isShowingMine} is true:
  64. broadcast "ONLINE"
  65. show 100 dust of stone at location 0.0 meters above location of {mine.user.%{_uuid}%.location} to {_player}
  66. wait 5 ticks
  67. delete {mine.user.%{_uuid}%.isShowingMine}
  68.  
Advertisement
Add Comment
Please, Sign In to add comment