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
|
  |
| 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 |
|