Player name on a TextLabel

I’m trying to make a TextLabel say the player’s name, but I’m getting the error “W001: Unknown global: Player”. It is a LocalScript in a TextLabel named “namelabel”.
Script:

local script = script.Parent
script.Parent.namelabel.Text = Player.Name

Note I’m a…bad scripter.

1 Like

game.Players.LocalPlayer.Name see if that works for you

That’s what works for me. Dont know why player.Name is so picky.

It worked, thanks a lot! I’ll keep that in mind in the future!

1 Like

No problem, good luck with your scripting journey.