Attempt to index nil with first name

  1. Change text label when player joins game.

  2. Says attempt to index nil

local remoteEvent = ReplicatedStorage:WaitForChild('RemoteEvent')
local player = game.Players.LocalPlayer
player.PlayerGui.Name.Frame.FirstName.Text = player.FName.Value
player.PlayerGui.Name.Frame.LastName.Text = player.LName.Value

Attempt to index what? Please clarify and add more detail.
What type of script is this?

Local script, it is attempting to index firstname.text

Can you show the FirstName and LastName place in the explorer?

Also, the problem could be PlayerGui.Name, Name is a child of PlayerGui or just an attribute of PlayerGui?

1 Like

It means whatever you were trying to index (get) failed and got nothing, maybe your syntax for getting the text label isn’t right or you can try to add :WaitForChild.

You know what that’s probably what it is

If you’re meaning the name of the GUI ( PlayerGui.Name) then I don’t see how you could do Name.Frame that’s what I mean

Yea I totally forgot name would contradict with it