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.

Cooldown For A Right Click Skript

Discussion in 'Skript' started by UnDeadExe, Dec 23, 2021.

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

    UnDeadExe Member

    Joined:
    Dec 23, 2021
    Messages:
    3
    Likes Received:
    0
    hey guys i was just wondering if you can help a stranger because its just that i tried to make a partneritem skript but i never knew how to add a cooldown to a right click skript what i did is that when u right clicked that item it does a command that has a cooldown and what happend is that players found the illegal command that the partneritem when right clicked executes so now i need help to make a new skript anyone please help me
    Version 1.17.1
    Failed Code:




    on right click:
    if player is holding magma cream of luck of the sea 10 named "&cRage Drive" with lore "&7", "&7When right clicked this item will give you", "&7Strength 2 for 10 seconds", "&7" and "&ePurchase at &d&lMythBox-Shop.Tebex.io&e!":
    execute player command "51527830101295763016392"
    remove 1 paper named "&c&lRage Ball" from player's inventory

    command /51527830101295763016392:
    cooldown: 2 minutes
    cooldown message: &8[&dPartner Items&8] &cYou Have To Wait &c&l%remaining% &cTo Use This Partner Item Again!
    cooldown bypass: partneritems.bypass
    trigger:
    send "" to player
    send "•&6 You have used a &cRage Drive" to player
    send "•&6 You are now on Cooldown For &f2 Minutes" to player
    send "" to player
    make console execute command "execute at %player% unless block ~ ~-1 ~ minecraft:bedrock run particle minecraft:angry_villager ~ ~1 ~ 0.3 0.3 0.3 0.125 10"
    make console execute command "effect give %player% strength 10 1"
    remove 1 magma cream named "&cRage Drive" with lore "&7", "&7When right clicked this item will give you", "&7Strength 2 for 10 seconds", "&7" and "&ePurchase at &d&lMythBox-Shop.Tebex.io&e!" from player's inventory
     
    #1 UnDeadExe, Dec 23, 2021
    Last edited: Dec 23, 2021
  2. King_Creeperz

    King_Creeperz Member

    Joined:
    Oct 6, 2020
    Messages:
    40
    Likes Received:
    0
    don't use numbers in commands. also PLEASE USE CODE BOXES
    upload_2021-12-23_14-50-25.png
    upload_2021-12-23_14-50-46.png

    And also just add variable cooldown and the rest of the code on the rightclick event
     
  3. UnDeadExe

    UnDeadExe Member

    Joined:
    Dec 23, 2021
    Messages:
    3
    Likes Received:
    0
    could you write an example because iam really bad at reasearch
     
  4. King_Creeperz

    King_Creeperz Member

    Joined:
    Oct 6, 2020
    Messages:
    40
    Likes Received:
    0
    Code (Text):
    1. if {itemnamecooldown::%player's uuid%} is true:
    2.   send "&cThis item is on cooldown!" to player
    3.  
    4.  
    5. set {itemnamecooldown::%player's uuid%} to true
    6. wait (cooldown) seconds
    7. set {itemnamecooldown::%player's uuid%} to false
    8.  
     
  5. UnDeadExe

    UnDeadExe Member

    Joined:
    Dec 23, 2021
    Messages:
    3
    Likes Received:
    0
    how do i make it so that it shows the cooldown when its right clicked? like instead of This Item Is on cooldown it says
    This Item is on cooldown for %remaining time%
     
  6. yea rite

    yea rite Active Member

    Joined:
    Jul 11, 2021
    Messages:
    73
    Likes Received:
    5
    Code (Text):
    1. on right click with stick:
    2.   if difference between {lastrightclick::%player%} and now >= 5 seconds:
    3.     set {lastrightclick::%player%} to now
    4.     do stuff
    5.   if difference between {lastrightclick::%player%} and not < 5 seconds:
    6.     send "&ccool down" to player
     
Thread Status:
Not open for further replies.

Share This Page

Loading...