#i think my variables bugging

1 messages · Page 1 of 1 (latest)

mental halo
#

i copied my other code but with another variable, and its not working and its only saying the cooldown and not doing the effect

on right click: item is {lbsword}: if {cooldown2::%player%} = true: apply invisibility 1 to the player for 10 seconds play sound "block.note_block.pling" with volume 15 to the player set {cooldown2::%player%} to false wait 20 seconds set {cooldown2::%player%} to true else: send "&c&lYou are on a cooldown for 20 seconds" to player play sound "entity.villager.no" with volume 15 to the player

the code i need help with ^^^

on right click: item is {bsword}: if {cooldown::%player%} = true: push player forward at speed 2 play sound "block.note_block.pling" with volume 15 to the player set {cooldown::%player%} to false wait 3 seconds set {cooldown::%player%} to true else: send "&c&lYou are on a cooldown for 3 seconds" to player play sound "entity.villager.no" with volume 15 to the player

my other code ^^^

#

@analog forum u online cuz i need help again

quasi gorge
#

Has the variable been initialised?

#

If not, the else: will just run every time

mental halo
mental halo
quasi gorge
#

there's no player in that event, so that wont work

#

I also really don't recommend variable names such as cooldown and cooldown2, as they arent really clear.

#

I think you should also be using timestamps not booleans