Zeldaboy111

Get gun ]|[ Skript #291

Feb 29th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.26 KB | None | 0 0
  1. #- Reselling/Reuploading while claiming that it is yours or made by you is disallowed
  2. #- Do not edit it and upload it as your own
  3. #- While using it in a video, please feature everything under "Video"
  4. #
  5. #Video:
  6. #Skript made by Zeldaboy111
  7. #More content of the creator: https://forums.skunity.com/search/26443679/
  8.  
  9. options:
  10. logo: &6Guns &8:&7
  11. cLogo: &f[&6Guns&f] &8:&7
  12.  
  13. on enable:
  14. set {guns.list::*} to "pistol" and "rifle"
  15. set {guns.info.names::*} to "&7Pistol" and "&9Rifle"
  16. set {guns.specs.shooting.types::*} to "semi-automatic" and "automatic"
  17. set {guns.specs.shooting.speed::*} to "1" and "4"
  18. set {guns.specs.shooting.strength::*} to "2" and "3"
  19. set {guns.specs.reload.speed::*} to "5" and "2"
  20.  
  21. #========================================
  22. # F U N C T I O N S
  23. #========================================
  24. function getGun(p: Player, gun: String):
  25. loop {guns.list::*}:
  26. if loop-value is {_gun} in lower case:
  27. set {_value} to loop-index
  28. stop loop
  29.  
  30. if {_value} is set:
  31. give {_p} iron horse armor named "%{guns.info.names::%{_value}%}%" without any NBT
  32. send "{@logo} &e%{_gun}% &7given!" to {_p}
  33.  
  34. else:
  35. send "{@logo} The gun &e%{_gun}% &7doesn't exist." to {_p}
  36.  
  37. function selectGun(p: Player):
  38. delete {heldGun.%{_p}%}
  39. delete {heldGun.%{_p}%.index}
  40. set {_name} to name of {_p}'s held item
  41.  
  42. loop {guns.info.names::*}:
  43. if loop-value is {_name}:
  44. set {heldGun.%{_p}%} to {guns.list::%loop-index%}
  45. set {heldGun.%{_p}%.index} to loop-index
  46. stop loop
  47.  
  48.  
  49. function gunInfo(p: Player, gun: String):
  50. send "{@logo} &c&lWIP &8(&7Work In Progress&8)" to {_p}
  51.  
  52. #========================================
  53. # C O M M A N D S
  54. #========================================
  55. command /guns [<text>] [<text>]:
  56. aliases: /gun
  57. trigger:
  58. executor is player:
  59. if player has permission "guns":
  60. if arg-1 is "help":
  61. send "&7&m &7{ &6Guns &7}&m "
  62. send "<cmd:/guns list><ttp:&8Get a list of all the guns>&e/guns list"
  63. send "<sgt:/guns get <gun>><ttp:&8Get a gun>&e/guns get <gun>"
  64. send "<sgt:/guns info [gun]><ttp:&8Get the information [about a gun]>&e/guns info [gun]"
  65. send "&7Tip&8: &7Try hovering over and clicking on the messages!"
  66. send "&7&m &7{ &6Guns &7}&m "
  67.  
  68. else if arg-1 is "list":
  69. send "{@logo} &7Here is a list from all the guns&8:%nl%&epistol&8, &erifle"
  70.  
  71. else if arg-1 is "get":
  72. if arg-2 is set:
  73. getGun(player, arg-2)
  74.  
  75. else:
  76. send "{@logo} &7You need to give up a &egun&7."
  77.  
  78. else if arg-1 is "info":
  79. if arg-2 is set:
  80. gunInfo(player, arg-2)
  81.  
  82. else:
  83. send "{@logo} &7You need to give up a &egun&7."
  84.  
  85. else:
  86. send "{@logo} &7Do &e/guns help &7for more info!"
  87.  
  88. else:
  89. send "{@cLogo} &7This command can only be executed by a player!"
  90.  
  91. on right click with iron horse armor:
  92. if {heldGun.%player%} or {heldGun.%player%.index} is not set:
  93. set {_new} to true
  94.  
  95. else if {heldGun.%player%} is not name of player's held item:
  96. set {_new} to true
  97.  
  98. if {_new}:
  99. selectGun(player)
  100.  
  101. if {heldGun.%player%} and {heldGun.%player%.index} is set:
  102. #INDEX AND GUN_NAME
  103. #SHOOT
  104.  
  105. on left click with iron horse armor:
  106. #RELOAD SYSTEM
Add Comment
Please, Sign In to add comment