while true do wait() if script.Parent.Value <0 then script.Parent.Value = 0 wait(.31) script.Parent.Parent:Destroy() end end -- lol
Well, if you destroyed the script's parent on the first iteration, the parent will not be existent anymore. Nil is the same thing as nothing, null, nonexistant, void.
If it manages to go through the if condition twice, it will try to destroy something that is not there. So, it will attempt to destroy nothing.
And, since Lua hates when something goes wrong (unlike html), it will error and cry under the sheets. So, you want to prevent that, right?
To prevent it, just check if the script has a parent, and if the script's parent's parent is available.
TL;DR, you should check if the scripts parent (and the script's parent parent) isn't nil.
P.S. To save yourself another line, instead of doing
while true do wait() print'green eggs in ham still hates sam i am' end;
you can do:
while wait() do print'green eggs in ham still hates sam i am' end;