Need help fixing script

I’m not really good at scripting so I’ll need some help with this one.

Basically I’m trying to destroy the parent of the script after its died

Local Humanoid.Died:connect(OnDeath)
	wait(10)
		script.Parent:Destroy()
	end
2 Likes
local Humanoid = -- humanoid location
Humanoid.Died:Connect(function()
wait(10)
script.Parent:Destroy()
end)
  1. You need to first define the variable [with low case ‘local’].
    like this:
local Humanoid = --path to Humanoid
  1. Now, you want to connect that to a Died event:
Humanoid.Died:Connect(function()
   task.wait(10)
   script.Parent:Destroy()
end)
  1. Take this note: dont use wait anymore. Use task.wait. It’s better.

I already said that with maybe less info but okay

1 Like