Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What Is The Script For An OverHead Name Tag?

Asked by 6 years ago

What Is The Script For Like For Example A "OWNER" Sign Above Your Head What Do You Put In The BillBoardGUI.

2 answers

Log in to vote
1
Answered by 6 years ago

Hiya!

Althought I am no expert and I must admit I am no GREAT scripter, I've been creating scripts like these for a while now.

I personally recommend creating a GUI first, such as the OWNER one you explained. Make it look nice and all so it saves you a lot of code. Put it in the script as a child.

My scripts might be outdated and whatnot so I'm sure someone else can improve mine, but a SIMPLE working example would be something like this:

local gui = script:FindFirstChild("GUINAME"):Clone()    --Gets the child from the script, which would be the GUI you created

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
    if player.Name == "YOURNAME"  then --Checks if you're the owner
        gui.Parent = character.Head --Adds the GUI to your head part
    end
end)
end)

Ofcourse there are many more ways of doing this, but I decided to keep it very short and simple. This does the trick and can always be improved later on.

0
I would clone the gui just before setting the parent. Good solution though. xAtom_ik 574 — 6y
0
Thanks Guys! DeathstrikePR 0 — 6y
0
Please consider marking this answer as solved to ensure both other forum posters see this question has been answered, and to improve our rep! User#20989 0 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

Two Ways:

Cloning and Manual

Cloning is easier and therefore I'll explain it here

Steps:

  1. Create a dummy, to test the GUI durring build stages

  2. Insert a SurfaceGui in its head

  3. Insert TextLabel

  4. Play arround with said TextLabel until satisfied

  5. Put said SurfaceGui in lighting

  6. Rename it for easy access (in this example, I'll call it "Tag")

  7. Add Script in ServerScriptService or Workspace:

game.Players.PlayerAdded:connect(function(Player)
    Player.CharacterAdded:connect(function(Char)
        local Gui = game.Lighting.Tag:clone() --Change tag to your SurfaceGui's name
        Gui.Parent = Char.Head
        --Player.NameDisplayDistance = 0 (Uncomment if you want player name tag to be invisible
    end)
end)

Answer this question