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

Acidic

Member
Feb 12, 2024
12
0
1
24
Hey there,

I am looking for some help with my skript for cooldowns.

Code:
on right click:
    if player is holding gold ingot:
        set {_c} to difference between {cd::%player's uuid%} and now
        {_c} < 10 seconds:
            send "&cWait %{_c}% seconds before using again" to player
            cancel event
            stop
        shoot arrow at speed 1



Basicially, when it sends the action bar, it counts up to 10 (e.x. 1... 2... 3..) but instead it should be counting down to 0 from 10 (e.x. 10... 5... 2... 1...). Also, it counts in hundredths decimal places instead of just a whole number. Basicially instead of 2.11, I want just 2.

Any help is extremely appreciated,
 
Hey there,

I am looking for some help with my skript for cooldowns.

Code:
on right click:
    if player is holding gold ingot:
        set {_c} to difference between {cd::%player's uuid%} and now
        {_c} < 10 seconds:
            send "&cWait %{_c}% seconds before using again" to player
            cancel event
            stop
        shoot arrow at speed 1



Basicially, when it sends the action bar, it counts up to 10 (e.x. 1... 2... 3..) but instead it should be counting down to 0 from 10 (e.x. 10... 5... 2... 1...). Also, it counts in hundredths decimal places instead of just a whole number. Basicially instead of 2.11, I want just 2.

Any help is extremely appreciated,
The issue with it being in a decimal format can be fixed if you use the round() function. It shouldn't need a separate function to be created and you'd just replace {_c} with round({_c}).