Advertisement
Zeldaboy111

Schiet Mechanisme ]|[ Skript #292

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