|
| 13 Jan 2012 02:57 AM |
| Since leaderboards('sfar as I know,) only work with int values, im trying to give a certain ammount of points to a player. However, when I set the reward value to 1.5, it rounds to 2. Why is that? If possible, how can I get around this? |
|
|
| Report Abuse |
|
|
Cyrok
|
  |
| Joined: 11 Jan 2012 |
| Total Posts: 630 |
|
|
| 13 Jan 2012 06:56 AM |
This is because IntValues only accept the integer data type, which is like a number but has to be whole without any decimal places. If you want to fix this, use a NumberValue, those accept both whole numbers and decimals.
1.5 -- Number 99 -- Integer and number, but RBX.Lua just tags it as an integer by default -2 -- Integer -54.9 -- Number
{ Have a short chunk of code that isn't working? Send me a message and maybe I can assist you. } |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 13 Jan 2012 07:06 AM |
Increase the currency and the cost of items.
<'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2012 02:34 PM |
| So NumberValues will work in place of IntValues under "leaderboard" in a player? |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2012 02:36 PM |
Probably.
And @Cykron or w/e
Lua HAS no concept of Integers. It's all floats, as far as I know. You can make ints, but it doesn't actually tag anything as an int. |
|
|
| Report Abuse |
|
|