setthreadidentity
Sets the thread identity level of the current execution thread.
function setthreadidentity(identity: number): ()Synopsis
How it works
Directly writes the identity integer into the current thread's
extraSpace->identity field. This immediately changes access permissions for all subsequent Roblox API calls on this thread. Setting identity 8 grants CoreScript-level access, including services like CoreGui, LogService, and other restricted APIs.Practical use
Commonly used to temporarily elevate identity for specific operations:
local old = getthreadidentity()
setthreadidentity(8)
-- access restricted API
setthreadidentity(old) -- restoreUsage
Elevate to CoreScript level
setthreadidentity(8)
print(getthreadidentity()) "cc">--> 8
"cc">-- Access identity-locked APIs...Parameters
identity number The target identity level (0–8).
Security
Irresponsible use of elevated thread identities can corrupt game state or bypass anti-cheat systems.
Aliases
Also available as setidentity and setthreadcontext.