cooldown on my skript

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

Status
Not open for further replies.

Skunk

Member
Dec 13, 2020
1
0
1
23
Hello i want to make a cooldown that you don't be able to click a fern for 10 seconds after you clicked a fern.
can someone help me?


command /drugs:
trigger:
message "&2Bedankt voor het gebruik maken van &aOFTENMT-Drugs"
message "&2/drugs &8- &aKrijg alle commands!"
message "&2/selldrugs &8- &aVerkoop al je huidige drugs!"
message "&2/drugs-info &8- &aKrijg alle info over drugs!"

command /drugs-info:
trigger:
message "&2Bedankt voor het gebruik maken van &aOFTENMT-Drugs"
message "&2/drugs &8- &aKrijg alle commands!"
message "&2/selldrugs &8- &aVerkoop al je huidige drugs!"


#Wiet
on rightclick:
clicked block is a Fern
delete event-block
send player title "&a&lFarmen..." with subtitle "&710 seconden cooldown" for 1 seconds
wait 1 seconds
send player title "&a&lFarmen..." with subtitle "&79 seconden cooldown" for 1 seconds
wait 1 seconds
send player title "&a&lFarmen..." with subtitle "&78 seconden cooldown" for 1 seconds
wait 1 seconds
send player title "&a&lFarmen..." with subtitle "&77 seconden cooldown" for 1 seconds
wait 1 seconds
send player title "&a&lFarmen..." with subtitle "&76 seconden cooldown" for 1 seconds
wait 1 seconds
send player title "&a&lFarmen..." with subtitle "&75 seconden cooldown" for 1 seconds
wait 1 seconds
send player title "&a&lFarmen..." with subtitle "&74 seconden cooldown" for 1 seconds
wait 1 seconds
send player title "&a&lFarmen..." with subtitle "&73 seconden cooldown" for 1 seconds
wait 1 seconds
send player title "&a&lFarmen..." with subtitle "&72 seconden cooldown" for 1 seconds
wait 1 seconds
send player title "&a&lFarmen..." with subtitle "&71 seconde cooldown" for 1 seconds
Give player 1 poisonous Potato with name "Wiet"
#Effects
set {cooldown::%player%} to 10 seconds
wait 10 seconds
set event-block to fern
if is less than a minute:
message "You have to wait %difference between a minute and {_waited}% before you can use this command again!"
 
Try this:
Code:
on rightclick:
    if clicked block is a Fern:
        if {cooldown::%player%} > 0:
            message "You have to wait %{cooldown::%player%} - convert date now to unix date% before you can use this command again!"
        else:
            delete event-block
            set {cooldown::%player%} to convert date now to unix date + 10

            loop 10 times:
                send player title "&a&lFarmen..." with subtitle "&7%loop-value% seconden cooldown" for 1 seconds
                wait 1 seconds

            clear {cooldown::%player%}
            set event-block to fern
            Give player 1 poisonous Potato with name "Wiet"

Note: not tested
 
Status
Not open for further replies.