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 out 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.

Getting display name of loop-mob into variable

Discussion in 'Skript' started by Crocie, Dec 17, 2021.

Thread Status:
Not open for further replies.
  1. Crocie

    Crocie Member

    Joined:
    Jul 2, 2021
    Messages:
    29
    Likes Received:
    0
    I want to spawn armor stands with names (of players) that teleport to their player

    Can anyone help?

    Code (Text):
    1. every 1 second:
    2.     loop all mobs:
    3.         if loop-mob is a armor stand:
    4.             set {_nick} to display name of loop-mob
    5.             broadcast "%{_nick}%"
     
  2. yea rite

    yea rite Active Member

    Joined:
    Jul 11, 2021
    Messages:
    73
    Likes Received:
    5
    follows player around
    Code (Text):
    1. on join:
    2.   summon armor stand
    3.   set display name of last spawned entity to "%player%"
    4.   apply potion of levitation of tier 0 to last spawned entity for 10 days
    5.  
    6. on damage of armor stand:
    7.   loop all players:
    8.     if display name of victim is "%loop-player%":
    9.       cancel event
    10.  
    11. on disconnect:
    12.   loop all entities:
    13.     if loop-entity is armor stand:
    14.       if display name of loop-entity is "%player%":
    15.         kill loop-entity
    16.  
    17. on player move:
    18.   loop all entities in radius 2 around player:
    19.     if loop-entity is armor stand:
    20.       if display name of loop-entity is "%player%":
    21.         if location of loop-entity is not location of player:
    22.           teleport loop-entity to player
     
    #2 yea rite, Dec 18, 2021
    Last edited: Dec 18, 2021
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...