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

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

Asked by 5 years ago
Edited 5 years ago

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

01local ServerStorage = game:GetService("ServerStorage")
02local nametag = ServerStorage.NameTag
03 
04game.Players.PlayerAdded:Connect(function(player)
05    player.CharacterAdded:Connect(function(char)
06        local head = char.Head
07        local newtext = nametag:Clone()
08        local Name = newtext.Name
09        --function
10        newtext.Parent = head
11        newtext.Adornee = head
12        Name.Text = player.Name
13    end)
14end)
0
Use the print function to catch bugs JesseSong 3916 — 5y

2 answers

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

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

1local char = script.Parent
2 
3char.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
4script.BillboardGui.TextLabel.Text = char.Name
5script.BillboardGui.Parent = char.Head
0
i know its a totally different way User#29913 36 — 5y
0
show me the other way Eric_pokemon 133 — 5y
0
Will this work?? User#29913 36 — 5y
0
this haven't work Eric_pokemon 133 — 5y
View all comments (4 more)
0
ok User#29913 36 — 5y
0
I fixed it lol Eric_pokemon 133 — 5y
0
Thanks for trying to help me Eric_pokemon 133 — 5y
0
sure User#29913 36 — 5y
Ad
Log in to vote
-1
Answered by 5 years ago

I dont know too =))

Answer this question