Some guy told me that it tries to destroy the parent twice, which causes this error.
local hum = script.Parent.Humanoid
script.Parent.Humanoid.MaxHealth = Random.new(50,100,120,75,60,65)
script.Parent.Humanoid.Health = script.Parent.Humanoid.MaxHealth
while wait() do
if hum.Health == 0 then
script.Parent:Destroy()
I'm trying to make a script that deletes a door when it's health reaches 0. But when the game starts up, it gives the question's title.(the error) I've tried doing it in two scripts (the 6th line loop) but no go. This is a ServerScript.

3 comments
Is there even an end to the while loop?
lol, I coded line 6 while making the question, and forgot the end... oops.
With "Random.new" you trying to get a random number from the set of numbers specified next to it?