Info of target player in actionbar

  • 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!

David

Member
Jan 31, 2017
16
0
1
20
I already did one of these but used the "on any move" that worked this way: When I looked at a player I would say his information (like money, clan) in the actionbar but if I stood still the information would no longer appear, I want a way to show a player's information in the actionbar even when stopped, can you do that in skript-mirror?

I'm using Google Translate
 
Use a while loop while the player is online or loop all players in an "every x ticks" statement. These will update whenever you see fit and do not require a player to move.

Example 1 (While Loop)
code_language.skript:
on join:
    while player is online:
        if player's targeted entity is a player:
            send action bar "&a%name of player's targeted entity% &7- &c%health of player's targeted entity%/%max health of player's targeted entity%" to player
        wait 5 ticks # Action bar will update 4 times a second.

Example 2 (Every x ticks)
code_language.skript:
every 5 ticks:
    loop all players:
        if loop-player's targeted entity is a player:
            send action bar "&a%name of loop-player's targeted entity% &7- &c%health of loop-player's targeted entity%/%max health of loop-player's targeted entity%" to loop-player
This is two examples of how you could do this. I have no idea which one is more efficient though.
 
Last edited:
  • Like
Reactions: David
Use a while loop while the player is online or loop all players in an "every x ticks" statement. These will update whenever you see fit and do not require a player to move.

Example 1 (While Loop)
code_language.skript:
on join:
    while player is online:
        if player's targeted entity is a player:
            send action bar "&a%name of player's targeted entity% &7- &c%health of player's targeted entity%/%max health of player's targeted entity%" to player
        wait 5 ticks # Action bar will update 4 times a second.

Example 2 (Every x ticks)
code_language.skript:
every 5 ticks:
    loop all players:
        if loop-player's targeted entity is a player:
            send action bar "&a%name of loop-player's targeted entity% &7- &c%health of loop-player's targeted entity%/%max health of loop-player's targeted entity%" to loop-player
This is two examples of how you could do this. I have no idea which one is more efficient though.
if i use ticks my server will lag?
 
It is less laggier than the "on any move" event I am pretty sure. I think you will be fine though. You can make the ticks higher if you don't want to risk lag. I just used 5 ticks as an example.
ok, thank you bro =)