So i am trying to get this script to call a function when the humanoids health is at "0" but when i run it, it doesn't do anything even though the function is a simple "print Word" into the output, why is it not working?
if script.Parent.Humanoid.Health == 0 then
PrintWord()
end
function PrintWord()
print 'Hello world!'
end

3 comments
Make sure to accept an answer btw.
This is worse, what happens if WalkSpeed, HealthDisplayDistance, HipHeight and NameDisplayDistance etc. etc. change to zero. Instead you should use HealthChanged: http://wiki.roblox.com/index.php?title=API:Class/Humanoid/HealthChanged
I had to make a few adjustmentst to this simplified script, for some reason it didnt want to run? But i just removed the variable and now it works fine thanks for the help guys.