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

Is there a way to check if something is a table/array?

Is it possible to check if a value is a table/array?

Let's say I want to send a value through a remote event, In the remote event how would I check if the value is a table or not?

1 answer

✓ Accepted answer

There is a built in function called typeof(val) that can be used for this purpose.

local x = 3
local y = {t=5}
local z = nil
print(typeof(x),typeof(y),typeof (z)) --> number table nil

2 comments

0

Thank you!

0

@NovaMagic no problem

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