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 » Scripting Helpers
Home Search
 

Re: Help me, this is important.

Previous Thread :: Next Thread 
aleksa12432 is not online. aleksa12432
Joined: 07 Jun 2012
Total Posts: 81
11 May 2014 04:43 PM
Look, I'm trying to create a health bar, and I am searching for calculation for the health.
Tryed:
fr.Size = UDim2.new(1/(hum.MaxHealth-hum.Health),0,1,0)
fr.Size = UDim2.new(1/(math.abs(hum.Health-hum.MaxHealth)),0,1,0)
*hum is Humanoid, fr is the health frame
-------------------------------------------------------------------
Can anybody give me a formula for that?
P.S.
Use scaled values.
Report Abuse
aleksa12432 is not online. aleksa12432
Joined: 07 Jun 2012
Total Posts: 81
11 May 2014 04:50 PM
Bump.
Report Abuse
aleksa12432 is not online. aleksa12432
Joined: 07 Jun 2012
Total Posts: 81
11 May 2014 04:57 PM
No one knows math?
Report Abuse
aleksa12432 is not online. aleksa12432
Joined: 07 Jun 2012
Total Posts: 81
11 May 2014 05:04 PM
Bump.
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
11 May 2014 05:04 PM
lol not really, but a free Bump for ya ;)
Report Abuse
aleksa12432 is not online. aleksa12432
Joined: 07 Jun 2012
Total Posts: 81
11 May 2014 05:05 PM
For gods sake, just help me.
Report Abuse
aleksa12432 is not online. aleksa12432
Joined: 07 Jun 2012
Total Posts: 81
11 May 2014 05:08 PM
Bump
Report Abuse
SuperSonic1350 is not online. SuperSonic1350
Joined: 27 Sep 2011
Total Posts: 935
11 May 2014 05:08 PM
everything is important, not jsut only yours
Report Abuse
aleksa12432 is not online. aleksa12432
Joined: 07 Jun 2012
Total Posts: 81
11 May 2014 05:09 PM
*Important for me*
Report Abuse
aleksa12432 is not online. aleksa12432
Joined: 07 Jun 2012
Total Posts: 81
11 May 2014 05:09 PM
Bumping... again...
Report Abuse
KAAK82 is not online. KAAK82
Joined: 06 May 2014
Total Posts: 1166
11 May 2014 05:10 PM
well u did do the health - maxhealth correct I can say that...
Report Abuse
aleksa12432 is not online. aleksa12432
Joined: 07 Jun 2012
Total Posts: 81
11 May 2014 05:11 PM
Yea, but its 'bugged', code.stypi.com/aleksa12432/testehcals.lua
Go to that link to help me.
Report Abuse
powertool is not online. powertool
Joined: 01 Feb 2008
Total Posts: 3771
11 May 2014 05:13 PM
Try this.

Your health is already a percentage, unless you're going over 100.

if humanoid.MaxHealth = 100 then
bar.Size = UDim2.new(0,humanoid.Health * scaleFactor,0,othervalue)
else bar.Size = UDim2.new(0,(100*(humanoid.Health/humanoid.MaxHealth)*scaleFactor),0,othervalue)
end
Report Abuse
aleksa12432 is not online. aleksa12432
Joined: 07 Jun 2012
Total Posts: 81
11 May 2014 05:15 PM
I don't use offset.
Report Abuse
powertool is not online. powertool
Joined: 01 Feb 2008
Total Posts: 3771
11 May 2014 05:15 PM
Then flip the values.

stuff,0,stuff,0 instead of 0,stuff,0,stuff. I gave you some help on the math.
Report Abuse
aleksa12432 is not online. aleksa12432
Joined: 07 Jun 2012
Total Posts: 81
11 May 2014 05:21 PM
Flipping the values will bug it, example:
Create a GUI and a frame
Test the frame size to UDim2.new(1,0,1,0), and then test the size to UDim2.new(0,1,0,1)
I think that its not the same result.
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
11 May 2014 05:33 PM
...lol
-=Robo=-
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
11 May 2014 05:40 PM
scale covers a percentage of a screen, while offset covers a number of pixels.

not what ur looking for, but oh well :P
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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