cooldown does not work

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

thomas2070

Member
Oct 20, 2024
2
0
1
23
i have a skript for a lightning wand but de cooldown doosn't work can someone fix it for me
thanks :emoji_slight_smile:
Code:
on right click with wooden hoe:
    if name of player's held item is "&9lightning wand":
    difference between now and {cooldown::%player's uuid%} is less than 5 seconds:
        message "On cooldown!" to player
    else:
        set {cooldown::%player's uuid%} to now
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~1 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-1 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~-1"
        wait 0.8 second
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~2 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-2 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~-2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~2 ~ ~1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-2 ~ ~1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~1 ~ ~2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~1 ~ ~-2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~2 ~ ~-1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-2 ~ ~-1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-1 ~ ~2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-1 ~ ~-2"
        wait 0.8 second
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~3 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-3 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~-3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~3 ~ ~1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-3 ~ ~1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~1 ~ ~3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~1 ~ ~-3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~3 ~ ~-1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-3 ~ ~-1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-1 ~ ~3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-1 ~ ~-3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~3 ~ ~2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~3 ~ ~-2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-3 ~ ~-2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-3 ~ ~2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-2 ~ ~-3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-2 ~ ~3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~2 ~ ~3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~2 ~ ~-3"
 
You don't really need to use a variable for the cooldown. You can set it by Here is the corrected script with the new cooldown system:

Code:
on right click with wooden hoe:
    if name of player's held item is "&9lightning wand":
    player has player's tool on cooldown:
        message "On cooldown!" to player
    else:
        set item cooldown of player's tool for player to 5 seconds
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~1 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-1 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~-1"
        wait 0.8 second
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~2 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-2 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~-2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~2 ~ ~1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-2 ~ ~1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~1 ~ ~2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~1 ~ ~-2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~2 ~ ~-1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-2 ~ ~-1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-1 ~ ~2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-1 ~ ~-2"
        wait 0.8 second
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~3 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-3 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~-3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~3 ~ ~1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-3 ~ ~1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~1 ~ ~3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~1 ~ ~-3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~3 ~ ~-1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-3 ~ ~-1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-1 ~ ~3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-1 ~ ~-3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~3 ~ ~2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~3 ~ ~-2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-3 ~ ~-2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-3 ~ ~2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-2 ~ ~-3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-2 ~ ~3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~2 ~ ~3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~2 ~ ~-3"

I really hope that this is working.
 
You don't really need to use a variable for the cooldown. You can set it by Here is the corrected script with the new cooldown system:

Code:
on right click with wooden hoe:
    if name of player's held item is "&9lightning wand":
    player has player's tool on cooldown:
        message "On cooldown!" to player
    else:
        set item cooldown of player's tool for player to 5 seconds
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~1 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-1 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~-1"
        wait 0.8 second
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~2 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-2 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~-2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~2 ~ ~1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-2 ~ ~1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~1 ~ ~2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~1 ~ ~-2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~2 ~ ~-1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-2 ~ ~-1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-1 ~ ~2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-1 ~ ~-2"
        wait 0.8 second
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~3 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-3 ~ ~"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~ ~ ~-3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~3 ~ ~1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-3 ~ ~1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~1 ~ ~3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~1 ~ ~-3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~3 ~ ~-1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-3 ~ ~-1"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-1 ~ ~3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-1 ~ ~-3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~3 ~ ~2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~3 ~ ~-2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-3 ~ ~-2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-3 ~ ~2"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-2 ~ ~-3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~-2 ~ ~3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~2 ~ ~3"
        make console execute command "/execute at %player% run summon minecraft:lightning_bolt ~2 ~ ~-3"

I really hope that this is working.
thank you