FWCentral Posted June 6, 2012 Share Posted June 6, 2012 The title pretty much says it all, I need to check if something is a string or a table, Here's what i tried; if namei == string then local name = namei else local name = table.concat(namei, " ") end but it still says in the debug table expected? Link to comment
Jaysds1 Posted June 6, 2012 Share Posted June 6, 2012 (edited) use: type try this: if type(namei) == "string" then local name = namei elseif type(namei)=="table" then local name = table.concat(namei, " ") end Edited June 6, 2012 by Guest Link to comment
FWCentral Posted June 6, 2012 Author Share Posted June 6, 2012 if type(namei) == string then local name = namei else local name = table.concat(namei, " ") end I tried that but didn't work Link to comment
Jaysds1 Posted June 6, 2012 Share Posted June 6, 2012 sorry, I've edited it again, the type returns a string, copy it again please Link to comment
FWCentral Posted June 6, 2012 Author Share Posted June 6, 2012 (edited) Edit: works fine thanks Edited June 6, 2012 by Guest Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now