The time till cooldown end not showing up

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

Ragingburger

Member
May 29, 2024
1
0
1
34
hi so i made a weapon and it should show a cooldown on an action bar but it doesn't


here is the action bar code
code_language.skript:
on join:
    while player is online:
        if player's tool is Iron Sword named "&6The wrath sword" with lore "&7Jump":
            set {_TIME} to difference between now and {cooldown::%player's uuid%}
            send action bar "On cooldown! Time left:  %{_TIME}%" to player
            wait 1 second
 
Attention, if you scroll from the sword, and after you come back to the sword, the server crash.

For me show what need to show, but this script doesn't set time to {cooldown::%player's uuid%}

You can be more explicitly

Code:
on join:
    set {cooldown::%player's uuid%} to now
    give an Iron Sword named "&6The wrath sword" with lore "&7Jump" to player
    while player is online:
        if player's tool is Iron Sword named "&6The wrath sword" with lore "&7Jump":
            set {_TIME} to difference between now and {cooldown::%player's uuid%}
            send action bar "On cooldown! Time left:  %{_TIME}%" to player
            wait 1 second

This can be usefull:
{variable} was less than a minute ago:
set {_yesterday} to 1 day ago
set {_hourAfter} to 1 hour after {someOtherDate}
set {_hoursBefore} to 5 hours before {someOtherDate}
 
Last edited: