generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: My health bar GUI wont update until I respawn.

Previous Thread :: Next Thread 
FiusenPvP is not online. 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
KritikalGunzz is not online. KritikalGunzz
Joined: 10 Nov 2013
Total Posts: 1633
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 is not online. JameulA
Joined: 07 Apr 2016
Total Posts: 66
08 Feb 2017 12:31 PM
lol u watch AlvinBlox...
Report Abuse
FiusenPvP is not online. FiusenPvP
Joined: 27 Apr 2014
Total Posts: 10
08 Feb 2017 12:31 PM
Still Don't work KritikalGunzz .-.
Report Abuse
UltimateRaheem is not online. UltimateRaheem
Joined: 10 Nov 2012
Total Posts: 1886
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 is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
08 Feb 2017 12:51 PM
Replace Color3.new with Color3.fromRGB


Report Abuse
FiusenPvP is not online. FiusenPvP
Joined: 27 Apr 2014
Total Posts: 10
08 Feb 2017 01:14 PM
Now work, thx all!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image