#Help with a cooldown for clicking

1 messages Β· Page 1 of 1 (latest)

cedar sky
#

im new to skript so idk what im doing, I need a cooldown so like when u click the composter u have to wait 15 seconds to click again, and another one for laundry, so to clean another pants it takes 30 seconds

brittle cypress
#

i got pinged from this location

cedar sky
#

maybe for a little help................

brittle cypress
#

do I know you??

stray stump
cedar sky
#

yeah I have no clue what im doing ngl, im new to this whole skript thing...........

cedar sky
stray stump
#

step 1: put the code in code blocks so people can actually read the indentation without discord messing with it

cedar sky
#

ah ok

stray stump
#

```code goes here```

#

example

brittle cypress
# cedar sky Maybe?

Haven't Skripted in like 7 months, I've forgotten everything what in gods name compelled you to ping me for help

cedar sky
stray stump
#

whenever you want the cooldown, add set {cooldownName::%player's uuid%} to now

cedar sky
#

hm

stray stump
#

then check if difference between {cooldownName::%player's uuid%} and now is less than 10 seconds:

#

or whatever the time is for it

#

if the difference is less than X seconds, it's still on cd

#

if its not, it is now off cooldown and you would be able to use it

cedar sky
#

hmm

stray stump
#

if you want like enderpearl cooldown shit there's item cooldown syntax; just depends on whether or not you're basing this on items or generic stuff

cedar sky
#

ah, I need mostly just based on whether u click a block

cedar sky
#

it just sends must wait 10 seconds

stray stump
#

bc you didn't use difference, and you need to set the variable to when it was last used

#

not 10 seconds

stray stump
#

set {cooldown::%player%::composter} to now

#

use player uuids instead of player names

#

in the event they change their name, data will be lost and unused and unnecessary variables will be added to the variables file

cedar sky
#

oh shoot is it supposed to be uuid

#

not uuids

snow grotto
# cedar sky ?

%player% is their username, while the uuid is like a serial number, a account-specific id

cedar sky
#

I have no clue what that means but yeah πŸ‘

snow grotto
#

in my case,
send "Hello %player%" to player = Hello x8ight
send "your uuid is: %player's uuid%" to player = your uuid is: 7345734aars-36346....

so when you store a variable as {variable::%player%} it's actually stored as {variable::x8ight}. but If I were to change my username to NoPulp, then any time you tried to access my {variable::%player%} it would instead go to {variable::NoPulp}, and not find the data already contained in {variable::x8ight}.

but since a player's UUID is specific to that Minecraft account, storing stuff in {variable::%player's uuid%} will always allow a player to get their data unless they log on on a completely different account

cedar sky
#

ah

#

but then why does line 3 not work?

#

I keep getting a error

snow grotto
#

because %uuids% isnt a thing skript can do. if you think about it, uuid**s** would be all the uuids that exist, one for each minecraft account.

you need to specify a player's uuid, like (event-)player's uuid or loop-player's uuid

cedar sky
#

hm

snow grotto
#

so like

  add 1 to {mined::%player's uuid%::diamondOre}
  send "You have mined a total of %{mined::%player's uuid%::diamondOre}% diamonds!" to player```
cedar sky
#

hmmm

#

that helps a lot πŸ™

#

ayyy that works now

#

thx for the help

cedar sky
#

because in line 11 it should like see whether u are holding it, but it dosent do anything and gives u the item instead

#

Do i do a stop at the end?

snow grotto
#

indentation isnt correct

#

should be like the top

cedar sky
#

oh okπŸ‘Œ

#

weirdly skript is telling me to make all of them 8 spaces

#

not like how I have it above

snow grotto
#

every time you go right it ahs to be consistent