Players.Jackwithgamingyt.Playergui.ScreenGui.LocalScript:93 尝试使用 'Name' 建立索引
Players.Jackwithgamingyt.Playergui.ScreenGui.LocalScript:93 attempt to index with 'Name'
所以我尝试使用 Plr.name 但确实如此 Players.Jackwithgamingyt.Playergui.ScreenGui.LocalScript:93 attempt to index with 'Name'
那么 Body 有帮助吗?
local Frame = script.Parent.Frame
local Text = script.Parent.Frame.TextLabel
Text.Text = "Lets Start" .. plr.Name .." "
我是否遗漏了什么?
根据您提供的代码示例,plr
似乎未定义。由于您使用的是 LocalScript,因此您可以使用 LocalPlayer property of the Players service.
访问当前播放器
local Text = script.Parent.Frame.TextLabel
local plr = game.Players.LocalPlayer
Text.Text = "Lets Start" .. plr.Name .." "
所以我尝试使用 Plr.name 但确实如此 Players.Jackwithgamingyt.Playergui.ScreenGui.LocalScript:93 attempt to index with 'Name'
那么 Body 有帮助吗?
local Frame = script.Parent.Frame
local Text = script.Parent.Frame.TextLabel
Text.Text = "Lets Start" .. plr.Name .." "
我是否遗漏了什么?
根据您提供的代码示例,plr
似乎未定义。由于您使用的是 LocalScript,因此您可以使用 LocalPlayer property of the Players service.
local Text = script.Parent.Frame.TextLabel
local plr = game.Players.LocalPlayer
Text.Text = "Lets Start" .. plr.Name .." "