Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Humanoid is not a valid member of Model?

Asked by 4 years ago

Sorry, this is probably stupid, but I really don't get it

local Player = game.Players.LocalPlayer
local Char = Player.CharacterAdded:Wait()
local Humanoid = Char.Humanoid

outputs "Humanoid is not a valid member of Model". How so? My script is in StarterPlayerScripts.

1 answer

Log in to vote
1
Answered by
0_2k 496 Moderation Voter
4 years ago
Edited 4 years ago

Ensuring this is a Local Script, and simple fix

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid") -- WaitForChild is efficient since the script is ran as the game starts, without it, it wont find a humanoid.
0
It just exited overflow with "Game script timeout". Is there something wrong with my studio? I honestly have no idea at this point. ItsNimbusCloud 66 — 4y
0
Ok. And sometimes it doesn't... This is clearly a problem on my side. Tnx for the reply tho ItsNimbusCloud 66 — 4y
0
Anytime 0_2k 496 — 4y
Ad

Answer this question