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.

For some reason my code doesn't work.

Discussion in 'Skript' started by Samuel Bobro, Jan 3, 2022.

Thread Status:
Not open for further replies.
  1. Samuel Bobro

    Samuel Bobro Member

    Joined:
    Jan 2, 2022
    Messages:
    4
    Likes Received:
    0
    I'm trying to make a command that slows down everyone around the person who clicks with an item. This is what I have so far:

    on rightclick:
    if player's held item is raw iron:
    if name of player's tool is coloured "&7&lRune of Slowness":
    cooldown: 10 seconds
    cooldown message: You last used this command in %elapsed time% ago, you may use it again in %remaining time%.
    command /execute positioned as %player% run effect give @e[distance=..50] slowness 20 7
    command /effect clear %player%

    --- Double Post Merged, Jan 3, 2022, Original Post Date: Jan 3, 2022 ---
    (I don't know why the cooldown doesn't work)
     
  2. rsrsamr

    rsrsamr New Member

    Joined:
    Jan 25, 2022
    Messages:
    8
    Likes Received:
    0
    format your skript
     
  3. Embry_

    Embry_ Member

    Joined:
    May 13, 2021
    Messages:
    12
    Likes Received:
    1
    The cooldown doesn't work because it has to be inside of a command.

    Example:

    Code (Text):
    1. command /commandhere:
    2.     cooldown: 1 minute
    3.     cooldown message: You must wait %remaining time%.
    4.     trigger:
    5.         #do code here
     
  4. YourFavoritePerson

    Joined:
    Feb 8, 2022
    Messages:
    20
    Likes Received:
    0
    how would you do a right click cooldown like
    on right click:
    send “Testing” to player
    cooldown: 5 seconds
    cooldown message: You must wait 5 seconds to do that again!
     
  5. sleepy unk

    sleepy unk Member

    Joined:
    Feb 8, 2022
    Messages:
    25
    Likes Received:
    0
    Code (Text):
    1.  
    2. on right click:
    3.     if {cooldown::%player's uuid%} is true:
    4.         send "&4&lYou must wait 5 seconds to do that again!" to player
    5.     else:
    6.         set {cooldown::%player's uuid%} to true
    7.         send "Testing" to player
    8.         wait 5 seconds
    9.         set {cooldown::%player's uuid%} to false
    10.  
    Untested, but that's what you're looking for.
     
  6. YourFavoritePerson

    Joined:
    Feb 8, 2022
    Messages:
    20
    Likes Received:
    0
    ok, thanks. I’ll go try it out; it works but idk how to use it with my other skript, could you please try to fix this?
    on right click:
    if player’s held item is iron axe named “&f&l&oStormbreaker”:
    if {cooldown::%player's uuid%} is true:
    send "&4&lYou must wait 5 seconds to do that again!" to player
    else:
    set {cooldown::%player's uuid%} to true
    if player is not sneaking:
    strike lightning at targeted block
    else:
    if player is sneaking:
    cancel event
    send "&f&l&oI AM THE MIGHTY THOR!" to the player
    damage targeted entity by 6 hearts
    wait 5 seconds
    set {cooldown::%player's uuid%} to false
     
    #6 YourFavoritePerson, Feb 9, 2022
    Last edited: Feb 9, 2022
  7. sleepy unk

    sleepy unk Member

    Joined:
    Feb 8, 2022
    Messages:
    25
    Likes Received:
    0
    Code (Text):
    1.  
    2. on right click with iron axe:
    3.     name of tool is "&f&l&oStormbreaker":
    4.         if {cooldown::%player's uuid%} is true:
    5.             send "&4&lYou must wait 5 seconds to do that again!" to player
    6.         else:
    7.             if player is sneaking:
    8.                 set {cooldown::%player's uuid%} to true
    9.                 set target on fire for 30 seconds
    10.                 while target is on fire:
    11.                     wait 1 tick
    12.                     damage target entity by 6
    13.                 wait 5 seconds
    14.                 set {cooldown::%player's uuid%} to false
    15.  
    ok so heres a better thor hammer test it if it works please send a feedback :emoji_grinning:
     
  8. YourFavoritePerson

    Joined:
    Feb 8, 2022
    Messages:
    20
    Likes Received:
    0
    it works! thanks for your help!
     
  9. sleepy unk

    sleepy unk Member

    Joined:
    Feb 8, 2022
    Messages:
    25
    Likes Received:
    0
    No problem, What's your discord? Feel free to contact me
     
  10. YourFavoritePerson

    Joined:
    Feb 8, 2022
    Messages:
    20
    Likes Received:
    0
    NobodyYouKnow#1150
    --- Double Post Merged, Feb 10, 2022, Original Post Date: Feb 10, 2022 ---
    I'm not allowed to friend strangers so I'll friend you, then unfriend you so we can chat
     
Thread Status:
Not open for further replies.

Share This Page

Loading...