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
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
How are you dealing the damage to humanoid
Also, if the if statement isn't in a while loop, then it won't continue to check
changed but still not working
try if script.Parent.Parent.Humanoid.Health < (whatever health it is here) then and see if that works ik it might be a bit older method but it should work