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

[DUDE OMG WHAT IS THIS?!??!] attempt to index nil with 'FindFirstChild'?

Player = game.Players.LocalPlayer
character = Player.Character
humanoid = character:FindFirstChild('Humanoid')

WHAT IS WRONG HERE?

6 comments

0

maybe try WaitForChild

0

i like just using character= game.workspace:FindFirstChild(player.name)

0

says attempt to index nil with 'WaitForChild' now

0

Just do character.Humanoid....

0

Try Using Qautation marks instead of Highens

0

I posted an answer, should work.........

1 answer

The problem here is the fact that the character does NOT exist (yet).

Give this a go :

local Player = game.Players.LocalPlayer
local character = Player.Character or Player.CharacterAdded:Wait()
local humanoid = character:WaitForChild('Humanoid')

1 comment

0

Make sure it's in a LocalScript in StarterGui or somewhere where LocalScripts can be ran.

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