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

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

Asked by 3 years ago
Player = game.Players.LocalPlayer
character = Player.Character
humanoid = character:FindFirstChild('Humanoid')

WHAT IS WRONG HERE?

0
maybe try WaitForChild botw_legend 502 — 3y
0
i like just using character= game.workspace:FindFirstChild(player.name) botw_legend 502 — 3y
0
says attempt to index nil with 'WaitForChild' now seethis12_UGLY -54 — 3y
0
Just do character.Humanoid.... Aztralzz 169 — 3y
View all comments (2 more)
0
Try Using Qautation marks instead of Highens overwatcher54 11 — 3y
0
I posted an answer, should work......... Aztralzz 169 — 3y

1 answer

Log in to vote
3
Answered by
Subsz 366 Moderation Voter
3 years ago

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')
0
Make sure it's in a LocalScript in StarterGui or somewhere where LocalScripts can be ran. killerbrenden 1537 — 3y
Ad

Answer this question