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

I made a a name tag but something is wrong. (?)

So I just made a basic NameTag gui but the name of the player won't show. It just show name(I named the text "Name") but it should show The text I have put in instead of the player name.

The errors are Expected ':' not '.' calling member function FindFirstChild and ServerScriptService.NameTagScript:12: attempt to index string with 'Text' but I don't know how to fix the errors

Script in ServerScriptService

local ServerStorage = game:GetService("ServerStorage")
local nametag = ServerStorage.NameTag

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		local head = char.Head
		local newtext = nametag:Clone()
		local Name = newtext.Name
		--function
		newtext.Parent = head
		newtext.Adornee = head
		Name.Text = player.Name
	end)
end)

1 comment

0

Use the print function to catch bugs

2 answers

I have an answer because I have done one of these custom name-tags. Insert BillboardGui into script: Insert into StarterPlayer.StarterCharacterScripts

local char = script.Parent

char.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
script.BillboardGui.TextLabel.Text = char.Name
script.BillboardGui.Parent = char.Head

8 comments

0

i know its a totally different way

0

show me the other way

0

Will this work??

0

this haven't work

0

ok

0

I fixed it lol

0

Thanks for trying to help me

0

sure

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