1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Cooldown help

Discussion in 'Skript' started by notjacob, Nov 3, 2019.

Thread Status:
Not open for further replies.
  1. notjacob

    notjacob Member

    Joined:
    Nov 3, 2019
    Messages:
    1
    Likes Received:
    0
    Hi I'm fairly new to skript, I coded this to give my players items but I don't want them to be able to spam it, what should I add if I want to make them wait 30 seconds between right clicks?

    https://pastebin.com/bqXM15wL
     
  2. Best Answer:
    Post #2 by AsuDev, Nov 3, 2019
  3. AsuDev

    VIP

    Joined:
    Jan 27, 2017
    Messages:
    244
    Likes Received:
    22
    Code (Skript):
    1. on right click on villager holding a cauldron:
    2.     if difference between {rewardcd.%uuid of player%} and now is less than 30 seconds:
    3.         send "&cYou must wait %difference between 30 seconds and difference between {rewardcd.%uuid of player%} and now% before doing that again." to player
    4.         stop
    5.     set {rewardcd.%uuid of player%} to now
    6.     set {_chance} to a random integer between 1 and 200
    7.     if {_chance} is between 1 and 24:
    8.         make console execute command "/msg %player% &2Treat! &7>> &2Take some Golden Candy"
    9.         give golden apple to player
    10.     if {_chance} is between 25 and 48:
    11.         make console execute command "/msg %player% &2Treat! &7>> &2Take some Sour Candy"
    12.         give apple to player
    13.     if {_chance} is between 49 and 72:
    14.         make console execute command "/msg %player% &2Treat! &7>> &2Take some Crunchy Candy"
    15.         give gold nugget to player
    16.     if {_chance} is between 73 and 96:
    17.         make console execute command "/msg %player% &2Treat! &7>> &2Take some Fluffy Candy"
    18.         give cake to player
    19.     if {_chance} is between 97 and 119:
    20.         make console execute command "/msg %player% &2Treat! &7>> &2Take some Sweet Candy"
    21.         give pumpkin pie to player
    22.     if {_chance} is between 119 and 120:
    23.         make console execute command "/cc give physical basic 1 %player%"
    24.         make console execute command "/bc &2&l%player%&r &2Has won the &lGRAND PRIZE!"
    25.     if {_chance} is between 121 and 200:
    26.         make console execute command "/eco take %player% 30"
    27.         make console execute command "/msg %player% &cTrick! &7>> &cYour money is mine now!"
     
Thread Status:
Not open for further replies.

Share This Page

Loading...