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: Custom health bar script

Previous Thread :: Next Thread 
Ipuo is not online. Ipuo
Joined: 24 Nov 2014
Total Posts: 11
29 Nov 2014 05:38 AM
Please tell me how add custom health bar script.
I remove standard health bar.
I make: Screen Gui (in Starter Gui) > make Frame and put green color > now please tell me script.
Report Abuse
Ipuo is not online. Ipuo
Joined: 24 Nov 2014
Total Posts: 11
29 Nov 2014 05:48 AM
wait(0.5)
local char = script.Parent.Parent.Parent.Character
hum = char.Humanoid
hum.Changed:connect(function()
script.Parent.Frame.Health.Frame.Size = UDim2.new(hum.Health/hum.MaxHealth,0,1,0)
script.Parent.Frame.Text.TextLabel.Text = ""..hum.Health.."/"..hum.MaxHealth..""
if hum.Health <= hum.MaxHealth*0.25 then
script.Parent.Frame.Health.Frame.BackgroundColor3 = Color3.new(255,0,0)
else
script.Parent.Frame.Health.Frame.BackgroundColor3 = Color3.new(0,255,0)
end
end)



This is not work. I dont know what to make bad.
Report Abuse
GeoVolcano is not online. GeoVolcano
Joined: 05 Jul 2012
Total Posts: 1433
29 Nov 2014 09:10 AM
1. Remove Default Health Gui
2. Screen Gui
3. Frame
4. Position a background frame and modify to your liking
5. Add another frame with the size being (.001, 0, 1 ,0) so that this will be at the uttermost left of the first frame
6. Change the background color to the color you would like the health to be
7. Insert script into 2nd frame
8. Inside script:

while true do
wait (0.01)
script.Parent.Size = UDim2.new((HumanoidHealth/HumanoidMaxHealth), 0 , 1 , 0 )
end

I didn't test it though.
Report Abuse
UnrealDevelopment is not online. UnrealDevelopment
Joined: 27 Dec 2012
Total Posts: 31
29 Nov 2014 09:42 AM
You seem to have missed some periods there to get the property of Humanoid @Geo

And that seems rather inefficient when you could do this:

Humanoid.Changed:connect(function()
--stuff
end)
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
29 Nov 2014 10:17 AM
Color3s support values between 0 and 1, they don't go up to 255.
Report Abuse
Ipuo is not online. Ipuo
Joined: 24 Nov 2014
Total Posts: 11
29 Nov 2014 10:39 AM
Its dont work.

Humanoid.Changed:connect(function()
while true do
wait (0.01)
script.Parent.Size = UDim2.new((HumanoidHealth/HumanoidMaxHealth), 0 , 1 , 0 )
end

I have problem in frame with size. I put .001, 0, 1 ,0 and system put 0.001,0 how change size?
This is formula from studio: {0,0}{0,0}

Report Abuse
Ipuo is not online. Ipuo
Joined: 24 Nov 2014
Total Posts: 11
29 Nov 2014 05:53 PM
ref
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