identity and returns the level that was active before the call.
Read the
getthreadidentity page entry to learn more.
Parameters
Returns
number - the previous identity (the level that was active before this call). Useful for save/restore: capture the return, do your work at the new identity, then pass it back into a second call to restore.
Aliases
setidentityset_thread_identitysetthreadcontext
Example
If you try torequire() a ModuleScript, while having your identity level set to 2, you will get an error:
Lacking capability RobloxScript.