For some reason my code doesn't work.

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

Samuel Bobro

Member
Jan 2, 2022
4
0
1
23
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%

[doublepost=1641242536,1641233357][/doublepost](I don't know why the cooldown doesn't work)
 
The cooldown doesn't work because it has to be inside of a command.

Example:

Code:
command /commandhere:
    cooldown: 1 minute
    cooldown message: You must wait %remaining time%.
    trigger:
        #do code here
 
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!
 
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!

Code:
on right click:
    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
        send "Testing" to player
        wait 5 seconds
        set {cooldown::%player's uuid%} to false

Untested, but that's what you're looking for.
 
Code:
on right click:
    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
        send "Testing" to player
        wait 5 seconds
        set {cooldown::%player's uuid%} to false

Untested, but that's what you're looking for.
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
 
Last edited:
Code:
on right click with iron axe:
    name of tool is "&f&l&oStormbreaker":
        if {cooldown::%player's uuid%} is true:
            send "&4&lYou must wait 5 seconds to do that again!" to player
        else:
            if player is sneaking:
                set {cooldown::%player's uuid%} to true
                set target on fire for 30 seconds
                while target is on fire:
                    wait 1 tick
                    damage target entity by 6
                wait 5 seconds
                set {cooldown::%player's uuid%} to false
ok so heres a better thor hammer test it if it works please send a feedback :emoji_grinning:
 
Code:
on right click with iron axe:
    name of tool is "&f&l&oStormbreaker":
        if {cooldown::%player's uuid%} is true:
            send "&4&lYou must wait 5 seconds to do that again!" to player
        else:
            if player is sneaking:
                set {cooldown::%player's uuid%} to true
                set target on fire for 30 seconds
                while target is on fire:
                    wait 1 tick
                    damage target entity by 6
                wait 5 seconds
                set {cooldown::%player's uuid%} to false
ok so heres a better thor hammer test it if it works please send a feedback :emoji_grinning:
it works! thanks for your help!
 
NobodyYouKnow#1150
[doublepost=1644529674,1644529639][/doublepost]I'm not allowed to friend strangers so I'll friend you, then unfriend you so we can chat
 
Status
Not open for further replies.