Zeldaboy111

Get gun ]|[ Skript #291

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