the script is
while true do wait(.001) if script.Parent.Parent.Humanoid.HealthChanged then script.Parent.Anchored = false end end
and inside explorer it looks like
Model ( parent ) Humanoid Part?? ( parent ) script
Incorrect usage of events.
You don't use events in if statements because they aren't conditions nor can they be used as conditions. Same reason why you don't use them in repeat
and while
loops.
Compare the Humanoid's Health value to 0 through a HealthChanged
function:
script.Parent.Parent.Humanoid.HealthChanged:Connect(function(newHealth) if newHealth == 0 then script.Parent.Anchored = false end end)
When HealthChanged
fires, it passes the new health value as its argument. Compare that value to 0 and you've got yourself a fully functional conditional statement.