Search code examples
luaroblox

Players.Jackwithgamingyt.Playergui.ScreenGui.LocalScript:93 attempt to index with 'Name'


So im trying to Use Plr.name But it did Players.Jackwithgamingyt.Playergui.ScreenGui.LocalScript:93 attempt to index with 'Name'

So Can any Body Help?

local Frame = script.Parent.Frame
local Text = script.Parent.Frame.TextLabel
Text.Text = "Lets Start" .. plr.Name .." "

Is There something I'm missing?


Solution

  • Based on the code sample you've provided, it looks like plr isn't defined. Since you are using a LocalScript, you can get access to the current player using the LocalPlayer property of the Players service.

    local Text = script.Parent.Frame.TextLabel
    local plr = game.Players.LocalPlayer
    Text.Text = "Lets Start" .. plr.Name .." "