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

Keep on getting an error (attempt to index nil with 'WaitForChild' error?)

I've been trying to script an inventory system for a little bit, but can't seem to get this script working. The error (

Players.NovaGooBoom.Backpack.LocalScript:15: attempt to index nil with 'WaitForChild'

Keeps on popping up in the output channel, my script is

https://pastebin.com/Y4Y4vs0m (can't figure out how to do the formating thing, sorry)

thanks.

1 comment

0

Sometimes, the script does not always understand what we are doing, try creating a variable for what you are requesting.

1 answer

✓ Accepted answer

You used '.Character' without giving it some time to load in. Try changing line 2 to this:

local Char = Plr.Character
repeat 
	wait()
	Char = Plr.Character
until Char ~= nil

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