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

NameTag Script wont work, No error's or anything, Please help?

I've been trying to make one of these for days n=but nothing seems to work any help appriciated thanks.


--Variables.
wait()
local Character1 = script.Parent
local d20Roler1 = script:FindFirstChild("BillBoardGuiSyn")


local d20Clone = d20Roler1:Clone()
d20Clone.Parent = Character1:FindFirstChild("Head")
d20Clone.Adornee = Character1:FindFirstChild("Head")
d20Clone.Frame.TextLabelSyn = Character1.Name

hierarchy: https://gyazo.com/cb567acb51c58b1c7f842950350b1cd5 script is in the script in StarterPlayerScripts

4 comments

0

Could you elaborate on what the script does?

0

So when a player spawns in It's supposed to give the player a nametag (of their name) on their head.

0

Your problem is the script is in the PlayerScripts, so your just putting it in their Player not Character.

0

How DO I fix it? @benbebop

1 answer

This is my method of nametags:

Step 1: Create a BillboardGui with a TextLabel inside. Call it NameLabel, and customize it to your liking

Step 2: Go ahead and go to the BillboardGui properties and change the StudOffset's Y value to 2. This is so the GUI element will be slightly above them.

Step 3: Name your GUI NameGui and put it ServerStorage for our script

Step 4: Now go to the StarterPlayer folder properties and change NameDisplayDistance to 0.

Step 5: Put a script in ServerScriptService with the following code inside:

--Get the GUI object
local serverStorage = game:GetService("ServerStorage")
local nameGui = serverStorage:WaitForChild("NameGui")

--Get the player's character
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local clonedGui = nameGui:Clone() --Have a new copy of NameGui
		clonedGui = character:FindFirstChild("Head") --Put the GUI on top of their head

		clonedGui.NameLabel.Text = player.Name --Set the NameLabel's text to their name
	end)
end)

Step 6: Load up the game to see a nametag over your head!

Hope this helped!

4 comments

0

Please help. I've been trying for 3 days ;/

0

I figured out the issue, change line 11 to this: clonedGui.Parent = character:FindFirstChild("Head")

0

Also change the BillboardGui's max distance to 30. Just a suggestion.

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