Discord Thread entity health

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

This thread came from the skUnity Discord. You can't reply to it here but if you join the skUnity Discord, you'll be able to post a reply there. The thread link is part of the thread's message.
Status
Not open for further replies.
You set the local variable in 1 event and its only use case is for that event, you cant use a local variable in other events

Posted by: falzz from the skUnity Discord.
 
code_language.skript:
on spawn of cow:
  wait 1 tick
  set {_entity} to event-entity
  set {_entity}'s name to "Cow &7[&r&4&l❤&r&8:&c %{_entity}'s health*2%&7]"
  
on damage:
  if victim is a cow:
    set victim's name to "Cow &7[&r&4&l❤&r&8:&c %{_entity}'s health*2%&7]"
it updates
but the health is 0 after i damage the cow

Posted by: _aaaaaaaaaaaaaaaaaaaaaaaaaaaa_ from the skUnity Discord.
 
code_language.skript:
on spawn of cow:
  wait 1 tick
  set {_hp} to last spawned cow's health * 2
  set last spawned cow's name to "&cCow &8[&r&4&l❤&r&8:&c %{_hp}%&8]"
  
on damage:
  if victim is a cow:
    wait 1 tick
    set {_hp} to victim's health * 2
    set victim's name to "&cCow &8[&r&4&l❤&r&8:&c %{_hp}%&8]"

Posted by: finrex01 from the skUnity Discord.
 
code_language.skript:
on spawn of entity:
  set {_entity} to event-entity
  set {_entity}'s name to "%{_entity}% &7[&r&4&l❤&r&8:&c %{_entity}'s health*2%&7]"
  wait 1 tick
  set {_hp} to last spawned entity's health * 2
  set last spawned entity's name to "%entity's name% &7[&r&4&l❤&r&8:&c %{_hp}%&7]"
  
on damage:
  if victim is an entity:
    wait 1 tick
    set {_hp} to victim's health * 2
    set victim's name to "%victim% &7[&r&4&l❤&r&8:&c %{_hp}%&7]"
can you help me make the first letter a capital letter?
the first letter of the mob's name

Posted by: _aaaaaaaaaaaaaaaaaaaaaaaaaaaa_ from the skUnity Discord.
 
Status
Not open for further replies.