Skip to content

setthreadidentity

setthreadidentity sets the current Luau thread identity and capabilities matching that identity.

This is commonly used alongside functions like gethiddenproperty or getconnections which may require elevated access.

function setthreadidentity(id: number): ()

Parameters

Parameter Description
id The identity level to set the current thread to.

Example

Changing thread identity for privileged access
1
2
3
4
5
setthreadidentity(2)
print(pcall(function() return game.CoreGui end)) -- Output: false (restricted access)

setthreadidentity(8)
print(pcall(function() return game.CoreGui end)) -- Output: true Instance