Jump to content

Why wont this cooldown work for item


TheMikal

Recommended Posts

on right click:
    if name of player's tool is "&6&l&oDasherr": 
        push player forwards at speed 1

on right click:
   if name of player's tool is "&6&l&oDasherr":
      set {cooldown.%player's uuid%} to 5 seconds

on right click:
    if name of player's tool is "&6&l&oDasherr":
        if {cooldown.%player's uuid%} > 0:
            send action bar "&cYou are on cooldown for %{cooldown.%player's uuid%}%&c more seconds." to player
            cancel event

 

the cooldown messages show up above hot bar but it still allows me to keep dashing forward.

Edited by TheMikal
Link to comment
Share on other sites

On 6/12/2024 at 6:04 PM, TheMikal said:

on right click:
    if name of player's tool is "&6&l&oDasherr": 
        push player forwards at speed 1

on right click:
   if name of player's tool is "&6&l&oDasherr":
      set {cooldown.%player's uuid%} to 5 seconds

on right click:
    if name of player's tool is "&6&l&oDasherr":
        if {cooldown.%player's uuid%} > 0:
            send action bar "&cYou are on cooldown for %{cooldown.%player's uuid%}%&c more seconds." to player
            cancel event

 

the cooldown messages show up above hot bar but it still allows me to keep dashing forward.

i would use the unix timestamp expression, i.e.:
 

set {_var} to unix timestamp of 5 seconds from now

if {_var} < unix timestamp of now:

 

 

 

image.png.bc433d6489d70ad831075fe76809b993.png
 

Owner of Lifestealed, Labs, Encore, UNOfficially and Observed
 

OG [VIP] 12/26/20 - 10/27/2021
OG [PRO] 12/27/21 - 11/18/2022
OG [LEGEND] 11/18/2022 - 3/14/2023
[DEFAULT] 3/14/2023 - 5/8/2024

[MOD] 5/8/2024 - Present

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...