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 4 years ago
Edited 4 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

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)
0
Use the print function to catch bugs JesseSong 3916 — 4y

2 answers

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

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
0
i know its a totally different way User#29913 36 — 4y
0
show me the other way Eric_pokemon 133 — 4y
0
Will this work?? User#29913 36 — 4y
0
this haven't work Eric_pokemon 133 — 4y
View all comments (4 more)
0
ok User#29913 36 — 4y
0
I fixed it lol Eric_pokemon 133 — 4y
0
Thanks for trying to help me Eric_pokemon 133 — 4y
0
sure User#29913 36 — 4y
Ad
Log in to vote
-1
Answered by 4 years ago

I dont know too =))

Answer this question