#weapon cooldown

1 messages · Page 1 of 1 (latest)

digital parrot
#

Why did you make a new post?

Anyways,

  1. Can you elaborate further than "doesnt work for some reason"?
  2. there's no player event-value in an on load: event. this means you cannot use the player expression there
  • you dont need to do that either, just delete that event
#
  1. dont loop all entities, just loop the ones in radius 5; loop all entities in radius 5 around player where [input != player]:
mighty vine
#

like the effects dont work

digital parrot
#

that still doesnt help...

mighty vine
digital parrot
mighty vine
#

sorry but it doesnt have errors and its supposed to effect the player with strength and effect the entites in a 5 block radius with weakness, whats happening that i dont want is its not working and when i rightclick no effects will show up

digital parrot
#

if so, its likely one of your conditions fail

mighty vine
#

could i have a skript doc

#
    permission: op
    permission message: &cNuh uh
    trigger:
        give player netherite sword named "&lAtmos Sword"
        

on rightclick:
    if name of event-item is "&lAtmos Sword":
        if difference between {atmosSwordCooldown::%player's uuid%} and now is greater than 60 seconds:
            loop all entities in radius 5 around player where [input != player]:
                    apply weakness 1 to loop-entity for 5 seconds
            apply strength 3 to player for 3 seconds
            set {atmosSwordCooldown::%player's uuid%} to now```
#

if i were to add loop all entities in radius 5 around player where [input != player]:

#
    permission: op
    permission message: &cNuh uh
    trigger:
        give player netherite sword named "&lAtmos Sword"
        

on rightclick:
    if name of event-item is "&lAtmos Sword":
        if difference between {atmosSwordCooldown::%player's uuid%} and now is greater than 60 seconds:
            loop all entities in radius 5 around player where [input != player]:
                apply weakness 1 to loop-entity for 5 seconds
            apply strength 3 to player for 3 seconds
            set {atmosSwordCooldown::%player's uuid%} to now``` heres the one with fixed indenting it still has the same issue
#
    permission: op
    permission message: &cNuh uh
    trigger:
        give player netherite sword named "&lAtmos Sword"
        

on rightclick:
    if name of event-item is "&lAtmos Sword":
        if difference between {atmosSwordCooldown::%player's uuid%} and now is greater than 60 seconds:
            message "Wait %{atmosSwordCooldown::%player's uuid%}%" to player
           
        else:
            loop all entities in radius 5 around player where [input != player]:
                apply weakness 1 to loop-entity for 5 seconds
                apply strength 3 to player for 3 seconds
                set {atmosSwordCooldown::%player's uuid%} to now``` new problem its working i think but it is displaying a time
#

here is an ss

digital parrot
#

yes

#

because the variable is set to that timestamp

#

this green part is how long they have currently waited

#

so you get the difference between 60s and that and that should be the remaining

mighty vine
#
    permission: op
    permission message: &cNuh uh
    trigger:
        give player netherite sword named "&lAtmos Sword"
        

on rightclick:
    if name of event-item is "&lAtmos Sword":
        if difference between {atmosSwordCooldown::%player's uuid%} and now is less than or equal to 5 seconds:
            message "Wait %{atmosSwordCooldown::%player's uuid%}%" to player
        else:
            loop all entities in radius 5 around player where [input != player]:
                apply weakness 1 to loop-entity for 5 seconds
                apply strength 3 to player for 3 seconds
                set {atmosSwordCooldown::%player's uuid%} to now``` new version seems to work but i would like it to show a timer of the cooldown
digital parrot
#

like in an action bar?

#

then just loop it

mighty vine
#

sure

#

i just have never made one could you send a doc?

digital parrot
#

I would just add it into the if difference between {atmosSwordCooldown::%player's uuid%} and now is less than or equal to 5 seconds: section you already have

mighty vine
#

i dont know how 🤷

digital parrot
#
  send action bar "..."
  wait 1 second```
mighty vine
#

how will i fix this error?

#

but i already have an else

digital parrot
mighty vine
#
    permission: op
    permission message: &cNuh uh
    trigger:
        give player netherite sword named "&lAtmos Sword"
        

on rightclick:
    if name of event-item is "&lAtmos Sword":
        while difference between {atmosSwordCooldown::%player's uuid%} and now <= 5 seconds:
            send action bar "..."
            wait 1 second
    else:
            loop all entities in radius 5 around player where [input != player]:
                apply weakness 1 to loop-entity for 5 seconds
                apply strength 3 to player for 3 seconds
                set {atmosSwordCooldown::%player's uuid%} to now```
#

sorry

digital parrot
#

put that while loop iniside the if statement

mighty vine
#

it is?

mighty vine
#

ohh crap

#
    permission: op
    permission message: &cNuh uh
    trigger:
        give player netherite sword named "&lAtmos Sword"
        

on rightclick:
    if name of event-item is "&lAtmos Sword":
        if difference between {atmosSwordCooldown::%player's uuid%} and now is less than or equal to 5 seconds:
            while difference between {atmosSwordCooldown::%player's uuid%} and now <= 5 seconds:
                send action bar "..."
                wait 1 second
    else:
        loop all entities in radius 5 around player where [input != player]:
            apply weakness 1 to loop-entity for 5 seconds
        apply strength 3 to player for 3 seconds
        set {atmosSwordCooldown::%player's uuid%} to now``` new code nothing works
digital parrot
#

yeah

#

look at the indentation

mighty vine
#

which part

mighty vine
#

hello?