If i fire m it will just summon infinite numbers of arrows all i wanted was a ammo cap to my gun so that it fires 15 then it will reload.
plz help
Code:
on right click:
if player is holding a soul torch named "&3&lM":
set {rplevel::%player%::*} to 0
if {holdclick::%uuid of player%} is not set:
set {holdclick::%uuid of player%} to 0
while {holdclick::%uuid of player%} < 1:
shoot arrow at speed 4
play sound "minecraft:block.amethyst_cluster.break" to player
play sound "minecraft:block.amethyst_cluster.place" to player
play sound "minecraft:block.amethyst_cluster.hit" to player
play 20 flame 1 infront player's head
add 1 to {rplevel::%player%::*}
if {rplevel::%player%::*} >= 15:
give player a stone named "&8&lReloading!"
remove a soul torch named "&3&lM" from player
play 20 lava pop at position of player to the player
send "&5reloading" to player
wait 10 seconds
remove a stone named "&8&lReloading!" from player
give player a soul torch named "&3&lM"
player has 5 iron nugget
remove 5 iron nugget from player
wait 1 tick
add 0.3 to {holdclick::%uuid of player%}
if {holdclick::%uuid of player%} is not set:
stop
delete {holdclick::%uuid of player%}
else:
set {holdclick::%uuid of player%} to 0
on script load:
delete {holdclick::*}