local String = "Test String"
local Table = {1,2,3,4,5}
How would I determine which variable stores what kind of data? Does that question make sense, or do I need to clarify?
local String = "Test String"
local Table = {1,2,3,4,5}
How would I determine which variable stores what kind of data? Does that question make sense, or do I need to clarify?
Use the type() method! So basically,
local String = "Test String"
local Table = {1,2,3,4,5}
print(type(String)) --> "string"
print(type(Table)) -->"table"
It returns a string of the name of your variable's data type. So when comparing:
if type(String) == "string" then -- right
if type(String) == string then --wrong!
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
you can also use typeof(), which does the same thing but includes roblox objects. of course, type() is faster if you aren't checking roblox objects :)