while wait() do
if script.Parent.Value.Value < 0 then
script.Parent.Text = "You lost...restarting."
wait(0.01)
script.Parent.Parent.OHealth.Value.Value = "4000"
script.Parent.Parent.OHealth.Text = "OPPONENT'S HEALTH: "..script.Parent.Parent.OHealth.Value.Value
script.Parent.Value.Value = "4000"
script.Parent.Text = "HEALTH: "..script.Parent.Value.Value
else script.Parent.Text = "HEALTH: "..script.Parent.Value.Value
end
end
COMMUNITY QUESTION
Why is this not working?
1 answer
i don't think using while wait() do is correct. You should put a true or false value or a value ><= so the loop goes on until the value changes.
when you set a health value you don't need to put "" you just write the number. For example: OHealth.Value.Value = 4000 and not OHealth.Value.Value = "4000". Unless it's a text or a stringvalue.
script.Parent.Parent.OHealth.Text = "OPPONENT'S HEALTH:""..script.Parent.Parent.OHealth.Value.Value.."" <---- Correct way of writing it
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Nothing happens at all
What is meant to happen?
fixed it anyway