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

How to get the text to change to the players name?

Asked by 5 years ago

Please help i can't get the text to change to the players name?

local Nametag = game:GetService("ReplicatedStorage"):WaitForChild("Nametag")

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        local ClonedNametag = Nametag:Clone()
        ClonedNametag.Parent = game.Workspace:WaitForChild(player.Name).Head
        wait(0.1)
        ClonedNametag.Name.Text = player.Name
    end)
end)

Error: "ServerScriptService.NametagScript:8: attempt to index field 'Name' (a string value)"

0
is there an object in ClonedNameTag called "Name"? because when you do ClonedNametag.Name it just gets the actual name of the object. PoePoeCannon 519 — 5y
0
that might be because every object has a property called "Name" theking48989987 2147 — 5y
0
Thanks retrobricks 162 — 5y
0
What I would do is give the player a custom nametag CarMaster17 28 — 5y

Answer this question