Getting display name of loop-mob into variable

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Crocie

Member
Jul 2, 2021
36
0
6
16
I want to spawn armor stands with names (of players) that teleport to their player

Can anyone help?

Code:
every 1 second:
    loop all mobs:
        if loop-mob is a armor stand:
            set {_nick} to display name of loop-mob
            broadcast "%{_nick}%"
 
follows player around
Code:
on join:
  summon armor stand
  set display name of last spawned entity to "%player%"
  apply potion of levitation of tier 0 to last spawned entity for 10 days

on damage of armor stand:
  loop all players:
    if display name of victim is "%loop-player%":
      cancel event

on disconnect:
  loop all entities:
    if loop-entity is armor stand:
      if display name of loop-entity is "%player%":
        kill loop-entity

on player move:
  loop all entities in radius 2 around player:
    if loop-entity is armor stand:
      if display name of loop-entity is "%player%":
        if location of loop-entity is not location of player:
          teleport loop-entity to player
 
Last edited:
  • Like
Reactions: Crocie
Status
Not open for further replies.