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
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