Hello, can someone help me with a script, please?
I started using skript recently and I don't know is that possible.
I want to make an entity's name that changes color if it's health is low.
Here's my script:
on spawn of cow:
set max health of event-entity to 25
set health of event-entity to 25
set event-entity's name to "&fDummy Cow &7[&a%event-entity's health%&7/&a%event-entity's max health%&7]"
on damage:
wait 1 tick
if victim is a cow:
if {%victim's health%} <= {%victim's max health%}*0.9:
set name of victim to "&fDummy Cow &7[&e%victim's health%&7/&a%victim's max health%&7]"
if {%victim's health%} <= {%victim's max health%}*0.5:
set name of victim to "&fDummy Cow &7[&c%victim's health%&7/&a%victim's max health%&7]"
else:
set name of victim to "&fDummy Cow &7[&a%victim's health%&7/&a%victim's max health%&7]"
on death of cow:
cancel drops of items
drop 1 Beef
(It doesn't change the color)
I started using skript recently and I don't know is that possible.
I want to make an entity's name that changes color if it's health is low.
Here's my script:
on spawn of cow:
set max health of event-entity to 25
set health of event-entity to 25
set event-entity's name to "&fDummy Cow &7[&a%event-entity's health%&7/&a%event-entity's max health%&7]"
on damage:
wait 1 tick
if victim is a cow:
if {%victim's health%} <= {%victim's max health%}*0.9:
set name of victim to "&fDummy Cow &7[&e%victim's health%&7/&a%victim's max health%&7]"
if {%victim's health%} <= {%victim's max health%}*0.5:
set name of victim to "&fDummy Cow &7[&c%victim's health%&7/&a%victim's max health%&7]"
else:
set name of victim to "&fDummy Cow &7[&a%victim's health%&7/&a%victim's max health%&7]"
on death of cow:
cancel drops of items
drop 1 Beef
(It doesn't change the color)