|
| 12 Jun 2013 12:40 AM |
In my RPG, there's this custom Health bar, and when your health is low, I want it to turn from green to red. And when it restores, I want it to change back. I wrote this script and it isn't working? Help?
P = script.Parent.Parent.Parent.Parent.Character.Humanoid
while true do
if P.Health > 0 and P.Health < (P.MaxHealth / 4) then script.Front.BackgroundColor3 = Color3.new (184, 18, 18) end if P.Health > (P.MaxHealth / 4) or P.Health < 1 then script.Front.BackgroundColor3 = Color3.new (0, 103, 0) end wait() end
|
|
|
| Report Abuse |
|
|
spearman2
|
  |
| Joined: 28 May 2010 |
| Total Posts: 2938 |
|
|
| 12 Jun 2013 05:09 AM |
Put an elseif
P = script.Parent.Parent.Parent.Parent.Character.Humanoid
while true do
if P.Health > 0 and P.Health < (P.MaxHealth / 4) then script.Front.BackgroundColor3 = Color3.new (184, 18, 18) elseif P.Health > (P.MaxHealth / 4) or P.Health < 1 then script.Front.BackgroundColor3 = Color3.new (0, 103, 0) end wait() end
|
|
|
| Report Abuse |
|
|
ForceSky
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 2379 |
|
| |
|
|
| 12 Jun 2013 06:20 AM |
| I dont think Health can do under 0 because it stops at zero I think so try instead of a > an => |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2013 03:04 PM |
| Nope. None of these works. I'll try and look into it more. |
|
|
| Report Abuse |
|
|