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
 

Round to nearest whole

Previous Thread :: Next Thread 
theninjaguy987 is not online. theninjaguy987
Joined: 21 Jun 2013
Total Posts: 766
28 Sep 2015 05:47 PM
So, I've been making a health GUI, and it displays the amount of health in numbers at the bottom of the bar. The bar is nice and working, same as the health/maxhealth in numbers, but the health is always in huge decimals, i.e "57.39562893/100" and it makes the text small and hard to see, which is not very eye attractive to players.

I have indeed come up with an alternate solution.
I would like to know if this would work or not: Have an updating IntValue of the humanoids health, and the IntValue would automatically round the number to a whole because it doesn't allow decimals, and in the script, instead of having "health/maxhealth", it could be "intvalue/maxhealth".

Even if this solution does work, I'm curious as to how I would be able to round a number to the nearest whole in a script.

Answers are greatly appreciated, thanks in advance!
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
28 Sep 2015 05:49 PM
math.floor, math.ceil

➳Lɪᴛᴀʟᴇʟᴀ ɪs ᴍʏ ɴᴀᴍᴇ, Lᴜᴀ ɪs ᴍʏ ɢᴀᴍᴇツ
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