Need help with my script

  • 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!

Status
Not open for further replies.

ANormalCoconut

New Member
Aug 1, 2022
8
0
1
15
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

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:
Status
Not open for further replies.