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

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

Asked by
Time_URSS 146
5 years ago

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

Log in to vote
3
Answered by 5 years ago

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.

0
In line 35 there's a variable: local Humanoid = part.Parent:FindFirstChild("Humanoid") Time_URSS 146 — 5y
Ad

Answer this question