I have this issue where it says "Humanoid isn't a valid member of player" It is in a localscript and this is what I have
local player = game.Players.LocalPlayer s = player.Humanoid while true do script.Parent.Text = s.Parent.Name wait() end
Basically, I have a ScreenGUI that has a textlabel and then this is a localscript is located inside of the textlabel.
We can get the Character by doing player.Character
. You can use .Character on any player to get the character. Sometimes the Character hasn't loaded though, so you would wait for the event CharacterAdded
to fire. Example,
local player = game.Players.LocalPlayer local char = player.Character or player.CharacterAdded:wait() local s = char:WaitForChild("Humanoid") while wait() do script.Parent.Text = s.Parent.Name end
Good Luck!