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!

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

Info of target player in actionbar

Discussion in 'Requests' started by David, Nov 3, 2019.

  1. David

    David Member

    Joined:
    Jan 31, 2017
    Messages:
    16
    Likes Received:
    0
    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
     
  2. AsuDev

    VIP

    Joined:
    Jan 27, 2017
    Messages:
    243
    Likes Received:
    21
    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 (Skript):
    1. on join:
    2.     while player is online:
    3.         if player's targeted entity is a player:
    4.             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
    5.         wait 5 ticks # Action bar will update 4 times a second.
    Example 2 (Every x ticks)
    Code (Skript):
    1. every 5 ticks:
    2.     loop all players:
    3.         if loop-player's targeted entity is a player:
    4.             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.
     
    #2 AsuDev, Nov 3, 2019
    Last edited: Nov 3, 2019
    • Like Like x 1
  3. David

    David Member

    Joined:
    Jan 31, 2017
    Messages:
    16
    Likes Received:
    0
    if i use ticks my server will lag?
     
  4. AsuDev

    VIP

    Joined:
    Jan 27, 2017
    Messages:
    243
    Likes Received:
    21
    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.
     
    • Like Like x 1
  5. David

    David Member

    Joined:
    Jan 31, 2017
    Messages:
    16
    Likes Received:
    0
    ok, thank you bro =)
     

Share This Page

Loading...