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
Use the print function to catch bugs