I'm trying to loop the code endlessly by using a while true do. Sometimes, when I change the Humanoid's property Health to zero using the Properties, the script works. However if I set my health to a higher number, and the health is drained using another script, until it reaches 0, nothing happens.
while true do
if script.Parent.Humanoid.Health == 0
then local a = Instance.new("Message")
a.Text = "The base has been destroyed. You have failed."
a.Parent = game.Workspace
wait (4)
a:remove()
end
end
I have a separate script in the same model "Base", to give the Humanoid more than 100 health. Here is that script. It's called HumanoidHealth
script.Parent.Humanoid.Health = 10
wait (1)
script.Parent.HumanoidHealth:Destroy()

1 comment
That works as well. I actually think your method was better than mine. I just tried to correct his doe. GG