Zeldaboy111

Schiet Mechanisme ]|[ Skript #292

Mar 5th, 2020
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.42 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. set {guns.specs.reload.amount::*} to "7" and "31"
  23.  
  24. #========================================
  25. # F U N C T I O N S
  26. #========================================
  27. function getGun(p: Player, gun: String):
  28. loop {guns.list::*}:
  29. if loop-value is {_gun} in lower case:
  30. set {_value} to loop-index
  31. stop loop
  32.  
  33. if {_value} is set:
  34. give {_p} iron horse armor named "%{guns.info.names::%{_value}%}%" with lore "" and "&7Ammo: %{guns.specs.reload.amount::%{_value}%}% / %{guns.specs.reload.amount::%{_value}%}%" without any NBT
  35. send "{@logo} &e%{_gun}% &7given!" to {_p}
  36.  
  37. else:
  38. send "{@logo} The gun &e%{_gun}% &7doesn't exist." to {_p}
  39.  
  40. function selectGun(p: Player):
  41. delete {heldGun.%{_p}%}
  42. delete {heldGun.%{_p}%.index}
  43. set {_name} to name of {_p}'s held item
  44.  
  45. loop {guns.info.names::*}:
  46. if loop-value is {_name}:
  47. set {heldGun.%{_p}%} to {guns.list::%loop-index%}
  48. set {heldGun.%{_p}%.index} to loop-index
  49. stop loop
  50.  
  51.  
  52. function gunInfo(p: Player, gun: String):
  53. send "{@logo} &c&lWIP &8(&7Work In Progress&8)" to {_p}
  54.  
  55. #========================================
  56. # C O M M A N D S
  57. #========================================
  58. command /guns [<text>] [<text>]:
  59. aliases: /gun
  60. trigger:
  61. executor is player:
  62. if player has permission "guns":
  63. if arg-1 is "help":
  64. send "&7&m &7{ &6Guns &7}&m "
  65. send "<cmd:/guns list><ttp:&8Get a list of all the guns>&e/guns list"
  66. send "<sgt:/guns get <gun>><ttp:&8Get a gun>&e/guns get <gun>"
  67. send "<sgt:/guns info [gun]><ttp:&8Get the information [about a gun]>&e/guns info [gun]"
  68. send "&7Tip&8: &7Try hovering over and clicking on the messages!"
  69. send "&7&m &7{ &6Guns &7}&m "
  70.  
  71. else if arg-1 is "list":
  72. send "{@logo} &7Here is a list from all the guns&8:%nl%&epistol&8, &erifle"
  73.  
  74. else if arg-1 is "get":
  75. if arg-2 is set:
  76. getGun(player, arg-2)
  77.  
  78. else:
  79. send "{@logo} &7You need to give up a &egun&7."
  80.  
  81. else if arg-1 is "info":
  82. if arg-2 is set:
  83. gunInfo(player, arg-2)
  84.  
  85. else:
  86. send "{@logo} &7You need to give up a &egun&7."
  87.  
  88. else:
  89. send "{@logo} &7Do &e/guns help &7for more info!"
  90.  
  91. else:
  92. send "{@cLogo} &7This command can only be executed by a player!"
  93.  
  94. on right click with iron horse armor:
  95. if {heldGun.%player%} or {heldGun.%player%.index} is not set:
  96. set {_new} to true
  97.  
  98. else if {heldGun.%player%} is not name of player's held item:
  99. set {_new} to true
  100.  
  101. if {_new}:
  102. selectGun(player)
  103.  
  104. if {heldGun.%player%} and {heldGun.%player%.index} is set:
  105. set {_lore::*} to lore of player's held item
  106. set {_ammo} to {_lore::2}
  107.  
  108. replace all "&7Ammo: " in {_ammo} with ""
  109. replace all " / %{guns.specs.reload.amount::%{heldGun.%player%.index}%}%" in {_ammo} with ""
  110. set {_ammo} to {_ammo} parsed as a number
  111.  
  112. if {_ammo} < 1:
  113. send "{@logo} You have to reload!"
  114.  
  115. else:
  116. set {_newLore::*} to {_lore::*}
  117. set {_newLore::2} to "&7Ammo: %{_ammo} - 1% / %{guns.specs.reload.amount::%{heldGun.%player%.index}%}%"
  118.  
  119. set lore of player's held item to {_newLore::*}
  120. play raw sound "BLOCK_LEVER_CLICK" at player with pitch 7 volume 10
  121.  
  122. loop 15 times:
  123. set {_loc} to location 1 meters above and loop-value-0.5 meters in front of player
  124. show 4 "Smoke Large" particles at {_loc} for player offset by 0.2, 0.2, 0.2
  125. loop all entities in radius 1 around location 1 meters above and loop-value meters in front of player:
  126. if loop-entity is not player:
  127. damage loop-entity by ({guns.specs.shooting.strength::%{heldGun.%player%.index}%} parsed as a number)
  128.  
  129. on left click with iron horse armor:
  130. #RELOAD SYSTEM
Advertisement
Add Comment
Please, Sign In to add comment