Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can you tell if a value is a table?

Say your making a script and by the end of it you tell it to return a value. You don't know what kind of value it is but you hope it's a table. How would you go about confirming that the value is a table?

1 answer

By using the type function!

tab = {}
print(type(tab))

if type(tab) == "table" then
	print("This will print!")
else
	print("but this won't! D:")
end

1 comment

0

Thanks... I completly forgot about the "type" function... :/

This discussion is preserved as it was. New answers, comments, and votes are closed.