Help w/Cooldown

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

    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!

froggo

Member
Jun 9, 2023
1
0
1
Code:
on right click:
    if name of player's held item contains "&egamingsword":
        if {pl::%player's uuid%} is not set:
            set {pl::%player's uuid%} to true
            set {_damage3} to 500
            send "&4Dagger thrown!" to player
            play sound "ENTITY_PLAYER_ATTACK_SWEEP" at volume 1 to player
            spawn armor stand at location 2 meters infront of player with nbt from "{Invisible:1}"
            set last spawned entity's helmet to stone sword
            set name of last spawned entity to "%player's name%"
            push last spawned entity in direction of player at speed 1.2
            loop 1 times:
                wait 10 ticks
            make 1 of explosion at location 1 meters behind and 1.5 meter above last spawned entity
            loop all mobs in radius 5 around last spawned entity:
                make player damage loop-mob by {_damage3}
            kill last spawned entity
            play sound "block_anvil_land" at volume 1 to player
            delete {pl::%player's uuid%}


Hi, I am trying to create a throwable dagger type item, how would I add a cooldown to this, whenever I try to add one it works but it spawns multiple of the sword when I only want it to spawn one.