#Actionbar health

1 messages · Page 1 of 1 (latest)

dense matrix
#

On join:
send action bar "Health: %player_health%/%player_maxhealth% to player
On damage:
set actionbar "Health: %player_health%/%player_maxhealth% to player

#

I want it to be forever but it doesnt work

gleaming rose
#

loop it

rare zodiac
#

change it when the player's health changes

dense matrix
#

Oke

velvet mauve
#

those are not correct expressions

dense matrix
#

Oh yeah just saw i thought i could use placeholderapi placeholders

velvet mauve
#

you dont need to, they are already built into skript as expressions

dense matrix
#

Its %health% and %max health% yeah?

velvet mauve
#

no

#
dense matrix
#

I just read

#

Xd

#

Yeah its %health%

velvet mauve
#

no

#

x's health

#

look at the syntax

#

sometimes the examples are meh

dense matrix
velvet mauve
#

you need to specify who's health

velvet mauve
dense matrix
#

Oh so %player's health%

#

And %player's max health%

velvet mauve
dense matrix
#

Ok bro

dense matrix
velvet mauve
#

Why show their health in an action bar when they already have a health bar?

rare zodiac
velvet mauve
dense matrix
dense matrix
#

On damage and on heal wouldnt be forever?

astral vessel
#
  while player is online:
    do stuff
    wait 10 ticks```
velvet mauve
astral vessel
#

yeah, but know that if you make an edit to the while code in an on join event, you will have to log off the server and on again to see the changes

velvet mauve
#

no they dont mean you relog to see any change, they mean you need to rejoin to trigger the on join: event, and then it will continuously update

gleaming rose
#

when you edit the skript you need to rejoin

#

or you could make it a function and make it accessible with an command

gleaming rose
#

fill in the blanks

    # do stuff
    
command /reloadactionbar:
    trigger:
        dostuff(player)
        
on join:
    while player is online:
        dostuff(player)
        wait 10 ticks```
velvet mauve
#

The function doesnt trigger the loop though

gleaming rose
#

wdym?

nimble nest
#

assuming the function sends the actionbar, the command would send the actionbar a single time

#

you would still need to rejoin in order for it to repeatedly send the actionbar

gleaming rose
#

ohh

#

Like this

    # do stuff
    
command /reloadactionbar:
    trigger:
        while player is online:
            dostuff(player)
            wait 10 ticks 
        
on join:
    while player is online:
        dostuff(player)
        wait 10 ticks```
velvet mauve
#

i dont see why the command is needed at all though

austere pagoda
nimble nest
#

easy testing for the thing you work on for about 5-10 minutes tops and never touch again

velvet mauve
#

It takes as much time to leave and rejoin as it would to type the command though

And its best to test exactly what will happen when someone joins

nimble nest
#

also those while loops are gonna stack