I have one script that when a humanoid dies it removes the humanoid and sets a BoolValue to true
function onHealthChanged()
script.Parent.CurHealth.Text = script.Parent.Parent.Parent.Humanoid.Health
if script.Parent.Parent.Parent.Humanoid.Health == 0 then
script.Parent.Parent.Parent.Parent.Dead = true
script.Parent.Parent.Parent.Humanoid:remove()
end
end
script.Parent.Parent.Parent.Humanoid.HealthChanged:connect(onHealthChanged)
and another script that when the BoolValue is true it removes a part
if script.Parent.Dead.Value == true then
script.Parent.Wall:Destroy()
end
but it doesnt remove the part and in the output it says Dead (The BoolValue) is not a valid member of model
