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

"Attempt to index field 'Parent' (a nil value)" How to solve it?

Greetings,

Testing a gun, I looked at the output, and saw this error message:

-- 14:01:27.682 - ServerScriptService.M4A1.MainScript:35: attempt to index field 'Parent' (a nil value)

How could I solve it?

1 answer

✓ Accepted answer

In general this means that the Parent object cannot be indexed (this can either be because you have prematurely destroyed it before a necessary call, or it just doesn't exist).

Take a look at line 35, see what it says, and seek to make amendments to whatever is being indexed's parent before/on line 35.

1 comment

0

In line 35 there's a variable: local Humanoid = part.Parent:FindFirstChild("Humanoid")

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