Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Humanoid is not a valid member of model error?

local Player = game.Players.LocalPlayer
local Char = Player.Character
local Hum = Char.Humanoid

says "Humanoid is not a valid member of model"

the error is on "local Hum = Char.Humanoid"

1 answer

###Because it's not. When that script runs, the player is loaded, but the character isn't. A fix would be to use the CharacterAdded event.

wait()
local Player = game:GetService("Players").LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()
local Hum = Char.Humanoid

This discussion is preserved as it was. New answers, comments, and votes are closed.