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
 

Why do Int Values not support numbers like 1.5, or 23.49223?

Previous Thread :: Next Thread 
Stickmen1337 is not online. Stickmen1337
Joined: 02 Jan 2012
Total Posts: 18
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 is not online. 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 is not online. 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
Stickmen1337 is not online. Stickmen1337
Joined: 02 Jan 2012
Total Posts: 18
13 Jan 2012 02:34 PM
So NumberValues will work in place of IntValues under "leaderboard" in a player?
Report Abuse
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
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
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