How do I find what kind of value something is? I’m trying to find if a value is a stringvalue, objectvalue, numbervalue, etc. etc.
I thought maybe you could find if it’s a stringvalue by using:
if tostring(value) then...
and maybe numbervalue by:
if tonumber(value) then...
and objectvalue:
if value.Name then...
Some of these might cause an error, so wrapping it in a pcall might be necessary. Also, if a stringvalue in the second example was a ‘0’, then it would pass fine.
Is there some universal way of finding what value something is, kind of like object:IsA()
but for values?
Edit: Both of the posts below are the solution, but sadly I can only mark one. Thanks guys!