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

I am trying to wait for humanoid to load, but I am getting an error?

local Players = game:GetService("Players")

local char = game:WaitForChild(Players.LocalPlayer.Character["Humanoid"])

local PShirt = char:FindFirstChild("Shirt")
local PPants = char:FindFirstChild("Pants")


wait(3)
print(PPants.PantsTemplate, PShirt.ShirtTemplate)

Error : Humanoid is not a valid member of Model "Workspace.Skeet4life"

1 comment

0

You have to use the WaitForChild method of the Character to obtain the Humanoid.

1 answer

✓ Accepted answer

First of all, if you're going to use game.Players.LocalPlayer, make sure the code is in a LocalScript. Also, to use Instance:WaitForChild(), you need to only use a string with the name of the child, and put the rest before WaitForChild() like this:

local char = Players.LocalPlayer.Character:WaitForChild("Humanoid")

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