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

Output error "attempt to index nil with 'FindFirstChild'", how to fix it?

I have no idea why this keeps happening, in the output the error says "attempt to index nil with 'FindFirstChild'" and when I tried accessing Humanoid without FindFirstChild, this came up "attempt to index nil with 'Humanoid'" If anyone has any idea I'd appreciate it!

2 comments

0

We'll need some code to examine, otherwise we can only guess what the problem is instead of knowing what the problem is. That being said, my guess is you're using a period before FindFirstChild instead of a colon.

0

Actually, it looks like you haven't waited for the character to load yet before trying to access its humanoid.

1 answer

You should be using WaitForChild for objects that have to load in.

i.e.,

local Humanoid = Character:WaitForChild("Humanoid")

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