Here is the script that is not working.
ShieldCharge = script.Parent.Parent.ShieldHealth.ShieldCharge TotalShield = script.Parent.TotalShield Charge = script.Parent.Charge.Value x = false repeat if Charge >= 1 then ShieldCharge.part1.BrickColor = BrickColor.New("Toothpaste") end wait(.5) until x == true
Its meant to have a parts color to change to Toothpaste once Charge has reached one or greater. The Charge is a NumberValue which is constantly increasing, but that script is not in question.
Any and all help will be greatly appreciated!
-MyNameIsGuiseppe
Try this:
ShieldCharge = script.Parent.Parent.ShieldHealth.ShieldCharge TotalShield = script.Parent.TotalShield Charge = script.Parent.Charge repeat if Charge.Value >= 1 then ShieldCharge.part1.BrickColor = BrickColor.New("Toothpaste") end wait(0.5) until Charge.Value >= 1 or ShieldCharge.part1.BrickColor == BrickColor.New("Toothpaste")
From my experience you can't get the value of the int unless returned from a function. This repeats the code until the value of charge is greater than or equal to 1. Then when charge is greater than or equal to one or the color of part1 was changed to Toothpaste it'll stop.