Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What Is The Script For An OverHead Name Tag?

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

2 answers

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.

4 comments

0

I would clone the gui just before setting the parent. Good solution though.

0

Thanks Guys!

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!

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.