Gun reloading skript

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Aug 8, 2021
37
0
6
21
Im making a gun like the one from hypixel zombies but it only says "hi" in chat when i left click and the ammo is low:

Code:
on left click:
    if the player is holding {pistolchamber.%player%} of {pistol}:
        send "hi"
        set {_dura} to the durability of the player's tool
        set {tool} to the player's tool
        set {_d} to 90% of {_dura}
        remove {_d} from durability of {tool}   
        wait 2 ticks
        set {_d} to 80% of {_dura}
        remove {_d} from durability of {tool}                   
        wait 2 ticks
        set {_d} to 70% of {_dura}
        remove {_d} from durability of {tool}   
        wait 2 ticks
        set {_d} to 60% of {_dura}
        remove {_d} from durability of {tool}                   
        wait 2 ticks
        set {_d} to 50% of {_dura}
        remove {_d} from durability of {tool}   
        wait 2 ticks
        set {_d} to 40% of {_dura}
        remove {_d} from durability of {tool}                   
        wait 2 ticks
        set {_d} to 30% of {_dura}
        remove {_d} from durability of {tool}   
        wait 2 ticks
        set {_d} to 20% of {_dura}
        remove {_d} from durability of {tool}               
        wait 2 ticks
        set {_d} to 10% of {_dura}
        remove {_d} from durability of {tool}   
        wait 2 ticks
        set {_d} to 0% of {_dura}
        remove {_d} from durability of {tool}               
        wait 2 ticks
        set {pistolchamber.%player%} to 10
        set {tool} to 10 wooden hoes named "&6Pistol" with lore "&7This is your starter gun. You're" and "&7gonna want to upgrade this at" and "&7some point."