Jump to content

How to Add Cooldown?


_Clout0son

Recommended Posts

Ive Been trying to add a Cooldown to this skript but its not working can someone help?
 

```on right click holding iron sword:
  name of player's tool is "&fAries Sword":
    push player forwards at speed 2.0
    cooldown: 5 seconds
    cooldown message: &fWait 5 seconds before Use again!```

Link to comment
Share on other sites

3 hours ago, SkriperManIkey said:

Cooldowns will only work on commands. Read this for more info https://github.com/Njol/Skript/blob/master/src/main/resources/scripts/command with cooldown.sk

Ohhhhhhhhhh ok thank you for telling me I was getting confused. but do you know how i can make it to where they can only use the item every 5 seconds like a enderpearl?

Link to comment
Share on other sites

1 hour ago, _Clout0son said:

Ohhhhhhhhhh ok thank you for telling me I was getting confused. but do you know how i can make it to where they can only use the item every 5 seconds like a enderpearl?

 

 

on right click holding iron sword:
  name of player's tool is "&fAries Sword":
  	if difference between now and {%player's uuid%.aresSword.lastUsed} is less than 5 seconds:
    	message "&fWait 5 seconds before use again!" to player
    else:
    	push player forwards at speed 2.0
        set {%player's uuid%.aresSword.lastUsed} to now

I haven't tested it, but I think this should work. Also I recommend you use code blocks when asking questions in the future because this formatting looks better. 

Let me know if it doesn't work.

Owner of oldgaffle.minehut.gg. (my paintball server)

Owner of karted.minehut.gg. (my mario kart server)

Advocate of individual freedom, especially freedom of speech.

Cooler than Stalemate128.

Link to comment
Share on other sites

2 hours ago, Checkmate128 said:

 

 

on right click holding iron sword:
  name of player's tool is "&fAries Sword":
  	if difference between now and {%player's uuid%.aresSword.lastUsed} is less than 5 seconds:
    	message "&fWait 5 seconds before use again!" to player
    else:
    	push player forwards at speed 2.0
        set {%player's uuid%.aresSword.lastUsed} to now

I haven't tested it, but I think this should work. Also I recommend you use code blocks when asking questions in the future because this formatting looks better. 

Let me know if it doesn't work.

this is the cooldown method

Every time you tell a lie, You'll have to tell a 100 more.

Link to comment
Share on other sites

19 hours ago, Checkmate128 said:

 

 

on right click holding iron sword:
  name of player's tool is "&fAries Sword":
  	if difference between now and {%player's uuid%.aresSword.lastUsed} is less than 5 seconds:
    	message "&fWait 5 seconds before use again!" to player
    else:
    	push player forwards at speed 2.0
        set {%player's uuid%.aresSword.lastUsed} to now

I haven't tested it, but I think this should work. Also I recommend you use code blocks when asking questions in the future because this formatting looks better. 

Let me know if it doesn't work.

No it doesnt work sry

Link to comment
Share on other sites

5 hours ago, _Clout0son said:

No it doesnt work sry

on right click holding iron sword:
  name of player's tool is "&fAries Sword"
  if difference between now and {%player's uuid%.aresSword.lastUsed} is less than 5 seconds:
    message "&fWait 5 seconds before use again!" to player
  else:
    push player forwards at speed 2.0
    set {%player's uuid%.aresSword.lastUsed} to now

This should work. Sorry I made a stupid error.

Edited by Checkmate128

Owner of oldgaffle.minehut.gg. (my paintball server)

Owner of karted.minehut.gg. (my mario kart server)

Advocate of individual freedom, especially freedom of speech.

Cooler than Stalemate128.

Link to comment
Share on other sites

5 hours ago, Lapzzo said:

Can I use this? I really need the cooldown thing

Sure.

Owner of oldgaffle.minehut.gg. (my paintball server)

Owner of karted.minehut.gg. (my mario kart server)

Advocate of individual freedom, especially freedom of speech.

Cooler than Stalemate128.

Link to comment
Share on other sites

19 hours ago, Checkmate128 said:
on right click holding iron sword:
  name of player's tool is "&fAries Sword"
  if difference between now and {%player's uuid%.aresSword.lastUsed} is less than 5 seconds:
    message "&fWait 5 seconds before use again!" to player
  else:
    push player forwards at speed 2.0
    set {%player's uuid%.aresSword.lastUsed} to now

This should work. Sorry I made a stupid error.

Thanks it works! sorry for asking much but is there a way i can make it to where certain people like only ops can bypass the cooldown?

Link to comment
Share on other sites

3 hours ago, _Clout0son said:

Thanks it works! sorry for asking much but is there a way i can make it to where certain people like only ops can bypass the cooldown?

on right click holding iron sword:
  name of player's tool is "&fAries Sword"
  if difference between now and {%player's uuid%.aresSword.lastUsed} is less than 5 seconds:
    message "&fWait 5 seconds before use again!" to player
  else:
    push player forwards at speed 2.0
    player is not op
    set {%player's uuid%.aresSword.lastUsed} to now

I think this should work.

Owner of oldgaffle.minehut.gg. (my paintball server)

Owner of karted.minehut.gg. (my mario kart server)

Advocate of individual freedom, especially freedom of speech.

Cooler than Stalemate128.

Link to comment
Share on other sites

  • 2 years later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...