I am creating a script for a smg and I cant detect how long they hold or how many times click. basically I want a ammo capacity
If there's any way I can get help and solve this please tell
Code:
on right click:
if player is holding a soul torch named "&7&lMP5":
player has 1 iron nugget
remove 1 iron nugget from player
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 5
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
wait 1 tick
add 1 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::*}
If there's any way I can get help and solve this please tell
Last edited: