1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Display player's health with hearts (not numbers)

Discussion in 'Skript' started by Hosom, Sep 17, 2019.

  1. Hosom

    Hosom Member

    Joined:
    Jul 10, 2017
    Messages:
    13
    Likes Received:
    0
    I am currently using SkRay fall.

    I want to display player's health in the tablist (and maybe also under the player's nametag) using hearts, not numbers.

    I tried this:

    set loop-player's tablist name to "Test: &7(&c%loop-player's health%/10&7)"

    But it displays like "(5/10)"

    I want it to display with hearts icons :emoji_slight_smile:
     
  2. malia

    malia Well-Known Member

    Joined:
    Jul 24, 2019
    Messages:
    271
    Likes Received:
    17
    Code (Skript):
    1. "%loop-player's health% <3"
    This?
     
    • Funny Funny x 1
  3. Hosom

    Hosom Member

    Joined:
    Jul 10, 2017
    Messages:
    13
    Likes Received:
    0
    lol :emoji_smile:

    Nope, i mean actual minecraft hearts, like this[​IMG]

    Instead when i use %loop-player's health% i get this:

    [​IMG]

    Also with your heart lol lol
     
  4. malia

    malia Well-Known Member

    Joined:
    Jul 24, 2019
    Messages:
    271
    Likes Received:
    17
    Wait that's either a mod or something to do with command blocks, not sure tho never seen that!
     
  5. Hosom

    Hosom Member

    Joined:
    Jul 10, 2017
    Messages:
    13
    Likes Received:
    0
    It's a vanilla command block thing, but skrayfall overwrites everything that changes tab in vanilla. And I can't use it anymore since I installed it
     
  6. b

    bigwillyman69 Member

    Joined:
    Aug 27, 2019
    Messages:
    17
    Likes Received:
    0
    /scoreboard objectives add hearts health
    /scoreboard objectives setdisplay list hearts
     
  7. Hosom

    Hosom Member

    Joined:
    Jul 10, 2017
    Messages:
    13
    Likes Received:
    0
    I used to do that but since I I stalled skrayfall the plugin completely overrides vanilla tab tab
     
  8. b

    bigwillyman69 Member

    Joined:
    Aug 27, 2019
    Messages:
    17
    Likes Received:
    0
    I know what to do.
    Either remove a chunk of your skript that modifies the tablist
    Or:
    remove skRayFall
     
  9. Hosom

    Hosom Member

    Joined:
    Jul 10, 2017
    Messages:
    13
    Likes Received:
    0
    Unfortunately the only script that changes tablist is this one that i made to replace the vanilla functionality since skrayfall overwritten it. And I can't remove skrayfall because I use it for a script with a lot of citizens NPC interactions. If you know a great alternative for spawning moving and despawning ncps with skript feel free to suggest :emoji_slight_smile:
     
  10. Poons

    Supporter

    Joined:
    Jan 25, 2017
    Messages:
    9
    Likes Received:
    2
    You could make your own heart system (this is not optimized but it works)
    Code (Text):
    1. on damage:
    2.     set {_count} to round(victim's health)
    3.     if {_count} < 10:
    4.         set {_blank} to (10 - {_count})
    5.         set {_final} to ""
    6.         loop {_count} times:
    7.             set {_final} to "%{_final}%&c❤"
    8.         loop {_blank} times:
    9.             set {_final} to "%{_final}%&7❤"
    10.     else:
    11.         set {_final} to "&c❤❤❤❤❤❤❤❤❤❤"
    12.     #code to set the tablist
    13.     #broadcast "%victim%'s health is %{_final}%"
     
Loading...