#No idea what to title this

1 messages · Page 1 of 1 (latest)

tender umbra
#
on rightclick:
    if "%lore of player's tool%" contains "&d&lHealer":
        cancel event
        if {tlsmp.mana.%uuid of player%.CurrentMana} > 49:
            set {_tempmana.%uuid of player%} to 50
            remove {_tempmana.%uuid of player%} from {tlsmp.mana.%uuid of player%.CurrentMana}

different skript

#This slowly regenerates mana over time.
every 2 seconds:
    loop all players:
        if {tlsmp.mana.%uuid of loop-value%.CurrentMana} < {tlsmp.mana.%loop-value's uuid%.maxMana}:
            add 1 to {tlsmp.mana.%uuid of loop-value%.CurrentMana}
        else if {tlsmp.mana.%uuid of loop-value%.CurrentMana} = {tlsmp.mana.%loop-value's uuid%.maxMana}:
            stop

No errors, but mana doesn't regenerated. Any idea why?

sacred oracle
#

Are the more than 1 player online?

#

During your regeneration code you're using stop if the mana has reached the max and I'm pretty sure it stops the loop. So if the first player that is looped has full mana noone else gets checked.

devout fulcrum
#

it does stop the loop

#

check if it isnt maxxed before adding

#

also use on join and a while loop

#

and use uuid variables

sacred oracle
#

I mean they don't even need the second if since it doesn't do anything if it's >=

devout fulcrum
#

yeah

sacred oracle
#

While loops can break with rejoins tho depending how long the wait is

devout fulcrum
#

?

#

unless its while they're in the region it shouldnt

sacred oracle
#

If you have a wait with 2 seconds in a while player is online: and they rejoin within those two seconds it starts a second while loop

devout fulcrum
#

oh

#

you said rejoin, i read region