Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What does 'type', and 'typeof', do ingame?

Asked by 4 years ago

Read the title! Is it difficult or something??? :)

1 answer

Log in to vote
1
Answered by
OhManXDXD 445 Moderation Voter
4 years ago

After reading off of devforum and developer.roblox.com, here's what I found.

Type(variable) is the Native Lua version and finds the type of the variable you put in. It can return:

“nil” (a string, not the value nil), “number”, “string”, “boolean”, “table”, “function”, “thread”, and “userdata”.

Typeof(variable) is the Roblox version and can find other Roblox types such as (but not limited to)

"Vector3", "Instance", nil (the value), and normal types like "number" and "string"

Info found in https://devforum.roblox.com/t/new-typeof-global-function/29992 and https://developer.roblox.com/en-us/api-reference/lua-docs/Lua-Globals

Ad

Answer this question