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
 

Re: How can I find if a number is an integer or not?

Previous Thread :: Next Thread 
doneyes is not online. doneyes
Joined: 21 Mar 2008
Total Posts: 3466
10 Jan 2013 05:05 PM
.02 and 4

4 is the integer. How can I find that out using a script? Also, I am not looking at rounding to an integer.
Report Abuse
MantarayJack is not online. MantarayJack
Joined: 22 Dec 2012
Total Posts: 183
10 Jan 2013 05:06 PM
4%1==0
Report Abuse
doneyes is not online. doneyes
Joined: 21 Mar 2008
Total Posts: 3466
10 Jan 2013 05:11 PM
would this check if 4 is an integer?


if 4%1 == 0 then
print("4 is an integer!")
end




would this work?
Report Abuse
doneyes is not online. doneyes
Joined: 21 Mar 2008
Total Posts: 3466
10 Jan 2013 05:15 PM
Nevermind, I think I got it.
Report Abuse
TerminalZero is not online. TerminalZero
Joined: 22 Oct 2011
Total Posts: 1001
10 Jan 2013 05:59 PM
Wow um you guys are dumbies... atleast I got a laugh out of this.

print(type(4))

That'll print what the number is.

if type(4) == "integer" then
print("Is an integer")
end

That'll print "Is an integer" if the number is an integer.
Leave scripting alone if you're not going to be serious...
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
10 Jan 2013 06:05 PM
@Terminal,
are you kidding me?
that would only return if it's a number or not.
Report Abuse
doneyes is not online. doneyes
Joined: 21 Mar 2008
Total Posts: 3466
10 Jan 2013 06:25 PM
Yeah terminal what I typed up worked perfectly fine. If the number had a decimal, it wouldn't print, if it was whole, than it would print. It doesn't matter what was printing, it was the fact that something printed. And I don't want it to check to see if the number is equal to a string.
Report Abuse
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
10 Jan 2013 06:39 PM
'Wow um you guys are dumbies...'

You are the only 'dumby' I see here.
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
10 Jan 2013 06:42 PM
"Leave scripting alone if you're not going to be serious..."
Maybe you should take your own advice
Report Abuse
TerminalZero is not online. TerminalZero
Joined: 22 Oct 2011
Total Posts: 1001
11 Jan 2013 05:22 PM
I don't see you posting any clever scripts Cody. I'm no pro at C++, but for me, Roblox Lua is as easy as reading.
Report Abuse
MassiveGman is not online. MassiveGman
Joined: 23 Jan 2011
Total Posts: 2019
11 Jan 2013 05:25 PM
Integer..

Any whole number not including zero.

I thought Lua allowed the use of Negatives..huh..who knew?
You might be able to create some type of function, so that when you plugin the number it returns the requested information.



|Paradoxical|
I shun thy heathen, dost thou not know that flames will devour thy mind?
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