How to i add a cooldown to this command?

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

0Palm0

New Member
Nov 19, 2022
5
0
1
15
i want to make it so when you rightclick the beehive it has a cooldown so you cant just spam it


Code:
on right click on a beehive:
    chance of 10%:
        give player bamboo named "&3Lockpick"
        send "You Found A LockPick With A &l10 &rprocent Chance! Wow" to player
    chance of 5%:
        give player speed potion named "&3Vitamins"
        send "You Found Vitamins With A &l5 &rprocent Chance! Wow" to player
    chance of 20%:
        give player 10 sunflowers named "&3Coin"
        send "You Found Coins With A &l20 &rprocent Chance! Wow" to player

on player consume potion:
    cancel event
    apply potion of swiftness to the player for 10 seconds
    remove 1 swiftness potion from the inventory of the player
 
i want to make it so when you rightclick the beehive it has a cooldown so you cant just spam it


Code:
on right click on a beehive:
    chance of 10%:
        give player bamboo named "&3Lockpick"
        send "You Found A LockPick With A &l10 &rprocent Chance! Wow" to player
    chance of 5%:
        give player speed potion named "&3Vitamins"
        send "You Found Vitamins With A &l5 &rprocent Chance! Wow" to player
    chance of 20%:
        give player 10 sunflowers named "&3Coin"
        send "You Found Coins With A &l20 &rprocent Chance! Wow" to player

on player consume potion:
    cancel event
    apply potion of swiftness to the player for 10 seconds
    remove 1 swiftness potion from the inventory of the player
Code:
if difference between {clickbeehive::%player%::lastuse} and now is smaller than a minute:
    set {_x} to now - {clickbeehive::%player%::lastuse}
    message "You have to wait %{_x}% seconds to do this again" to player
[doublepost=1668903344,1668903244][/doublepost]
Code:
if difference between {clickbeehive::%player%::lastuse} and now is smaller than a minute:
    set {_x} to now - {clickbeehive::%player%::lastuse}
    message "You have to wait %{_x}% seconds to do this again" to player
if you dont want your players to get more than 1 reward add a stop like this on each chance.
Code:
chance of 10%:
    give player bamboo named "&3Lockpick"
    send "You Found A LockPick With A &l10 &rprocent Chance! Wow" to player
    stop
 
do i need any plugins because it does not understand
Code:
set {_x} to now - {clickbeehive::%player%::lastuse}
 
do i need any plugins because it does not understand
Code:
set {_x} to now - {clickbeehive::%player%::lastuse}
no it was my mistake try this
Code:
set {_y} to now
set {_x} to {_y} - {clickbeehive::%player%::lastuse}
 
no it was my mistake try this
Code:
set {_y} to now
set {_x} to {_y} - {clickbeehive::%player%::lastuse}

it now says that i have to indent
Code:
if difference between {clickbeehive::%player%::lastuse} and now is smaller than a minute:
how do indent it? i have tried 1,2 and 3 tabs.
 
Status
Not open for further replies.