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: GUI help

Previous Thread :: Next Thread 
OKevinO is not online. OKevinO
Joined: 05 May 2010
Total Posts: 1036
07 Apr 2015 09:18 PM
I can't seem to figure out how to resize a frames scale according to the amount of cash i currently have. So if i can have a total of 10,000 cash (max amount), and i have for example 2,573 cash, whats the math to resize the frames scale so the frame resizes to the correct size to make it seem like i have 2,573/10,000 cash?

Keep in mind that i don't want to directly use the number 10,000 in the line (the number could be anything), instead define the value using an IntValue.

I know for sure that if i were to make a custom health bar, i would multiply the frames scale by the current HP of your characters humanoid, and divide by the max HP. I'm trying to do something similar to this for what i'm trying to do, but i can't seem to get it right, please help!
Report Abuse
morash is not online. morash
Joined: 22 May 2010
Total Posts: 5834
07 Apr 2015 09:20 PM
percent = value/total --value = money, total = that IntValue's value.
frame.Size = UDim2.new(percent,0,1,0)
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