How do you check if a variable is a number or a string?
local variable = --Insert Val if (type(variable) == "string") then --String elseif (type(variable) == "number") then --Number else --Some other end
Hey SimplyJeremy,
local num = 1 local str = "Whatever" if type(num) == 'number' then print("It is a number.") else print("It is not a number.") print(type(num)) -- Prints number print(type(str)) -- Prints string
Thanks,
Best regards,
KingLoneCat