I'm really confused. I simply wanted a script to destroy its parent (and itself), that's all. You can find the rest of my code here.
You can easily notice this part (I added parent here):
if not closeEnough then script.Parent:Destroy() end
The problem is, it says that parent is nil. So I did this:
if not closeEnough then if script.Parent then script.Parent:Destroy() else script:Destroy() end end
The results were slightly strange, so I added an error function:
if not closeEnough then if script.Parent then script.Parent:Destroy() else script:Destroy() end error("my life is a lie") end
And guess what.
my life is a lie
ROBLOX is weird.
You can use return. Example:
do return end print(1) -- wont print