#Timer and more

1 messages · Page 1 of 1 (latest)

chrome steeple
#

Theres a github tutorial for an item cooldown

#

I dont have the link

#

Google it

#

Just set a var to now and then on right click check if the difference is longer than the cooldown

chrome steeple
#

Look at the messages i sent earlier. There is a tutorial for this exact thing with examples

#

Its on github. Im in a car omw to vacation, i cant really find it as i rarely have reception rn. If you cant find it someone can send it to you

knotty roost
#

you can do a on join while player is online loop: on join: while player is online: if {yourVar::%player%} >= 0: remove 1 from {yourVar::%player%} wait 1 second

chrome steeple
#
wait {_cooldown} seconds
if difference between {cooldown::%{_p}’s uuid%::%{_name}%} and now >= {_cooldown}:
  delete {cooldown::%{_p}’s uuid%::%{_name}%}```
#

Then just check if the cooldown is set when they use the item. If it is, dont let them use it

#

You could make it a function, then use it for any item, or even combat log

#

Dont just copy and paste things

#

Use your brain.

#

You need to input a duration as well

#

Or 10min

#

Either

#

Could also use ticks or days or years

#

As long as its the same

#

No

#

Change it back to {_cooldown

#

You need to add a parameter

#

Next to the functions name

#

Add cooldown as a timespan

#

player: player, duration: timespan, name: string

knotty roost
#

why are you coding at 4am

chrome steeple
#

The “can’t understand condition/effect” is from copy-pasting the apostrophe from discord. Retype it. Just wait {_duration}, no seconds, you have to specify seconds or minutes when you call the function

#

Change the parameters name from value to name

#

And change the “value” in the variable to “cooldown”

#

Pffft

#

Toby did that all send at once for you?

knotty roost
#

no. once each line

chrome steeple
#

But like in rapid succession?

knotty roost
#

yep

chrome steeple
#

I just got into an area with service again lol

knotty roost
#

nice

chrome steeple
#

Oh, nvm

chrome steeple
#

4 for me now

chrome steeple
#

Well ima go to sleep, hopefully you can figure this out cause idk how long ima be out for