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: How to tell if tables contain string or numbers?

Previous Thread :: Next Thread 
dans59IsMyMom is not online. dans59IsMyMom
Joined: 15 Jan 2010
Total Posts: 421
25 Nov 2016 12:19 PM
table1 = {2}
table2 = {"stiiky"}
the issue is, the two tables can switch at any moment how could I do like

if table1 = number then
print("table 1 is number")
else
print("table 1 is string")
end
Report Abuse
caca50 is not online. caca50
Joined: 10 Jul 2011
Total Posts: 2037
25 Nov 2016 12:21 PM
iterate through the values of the table and use 'type()'


Roblox.Forum.Scripters:1: bad argument #1 to 'intellect' (number expected, got nil)
Report Abuse
dans59IsMyMom is not online. dans59IsMyMom
Joined: 15 Jan 2010
Total Posts: 421
25 Nov 2016 12:23 PM
thanks. didnt know that existed.
Report Abuse
hephzibah112 is not online. hephzibah112
Joined: 21 Sep 2012
Total Posts: 327
25 Nov 2016 12:28 PM
I agree with caca, you can also use "type()" when coding in Python.
Report Abuse
dans59IsMyMom is not online. dans59IsMyMom
Joined: 15 Jan 2010
Total Posts: 421
25 Nov 2016 12:34 PM
ooh, thanks for that too. I plan to learn python and c++
Report Abuse
RainingUpwards is not online. RainingUpwards
Joined: 10 Apr 2012
Total Posts: 434
25 Nov 2016 12:36 PM
Skip python. C++ is great. Or learn Javascript instead of python :P


295,562 slices of pizza and counting
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
25 Nov 2016 12:49 PM
no lol javascript sucks
Report Abuse
hephzibah112 is not online. hephzibah112
Joined: 21 Sep 2012
Total Posts: 327
25 Nov 2016 01:10 PM
I have 3+ experience in Python, JavaScript, and C++. In fact, I'll teach you all three for free if you want.
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