FiusenPvP
|
  |
| Joined: 27 Apr 2014 |
| Total Posts: 10 |
|
|
| 08 Feb 2017 11:53 AM |
I have a problem. My health bar wont update until I respawns, i need help plzz! SCRIPT I USE:
wait(2) game.Players.LocalPlayer.Character.Humanoid.Changed:connect(function() local redzone = game.Players.LocalPlayer.Character.Humanoid.MaxHealth / 4 if game.Players.LocalPlayer.Character.Humanoid.Health <= redzone then script.Parent.BackgroundColor3 = Color3.new(255,0,0) end if game.Players.LocalPlayer.Character.Humanoid.Health > redzone then local brickcolor = BrickColor.new("Lime green") local color = brickcolor.Color script.Parent.BackgroundColor3 = color end script.Parent.Size = UDim2.new(game.Players.LocalPlayer.Character.Humanoid.Health / game.Players.LocalPlayer.Character.Humanoid.MaxHealth,0,0,20)
end) |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2017 11:56 AM |
There's a function of Humanoid called HealthChanged which fires when the health changes. Use that instead.
http://wiki.roblox.com/index.php?title=API:Class/Humanoid/HealthChanged |
|
|
| Report Abuse |
|
|
JameulA
|
  |
| Joined: 07 Apr 2016 |
| Total Posts: 66 |
|
| |
|
FiusenPvP
|
  |
| Joined: 27 Apr 2014 |
| Total Posts: 10 |
|
|
| 08 Feb 2017 12:31 PM |
| Still Don't work KritikalGunzz .-. |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2017 12:33 PM |
Don't just rely on other people to spoon feed you answers.
I understand that you are struggling with this, but please but some effort into it. The Wiki contains an API which is very useful.
<-- Want to be supported by developers in a positive atmosphere? Then join Studio BSD! |
|
|
| Report Abuse |
|
|
JoshRBX
|
  |
| Joined: 19 May 2012 |
| Total Posts: 8778 |
|
|
| 08 Feb 2017 12:51 PM |
Replace Color3.new with Color3.fromRGB
|
|
|
| Report Abuse |
|
|
FiusenPvP
|
  |
| Joined: 27 Apr 2014 |
| Total Posts: 10 |
|
| |
|