Skip to content

Thread Identity

Functions for managing thread identity (context level) and checking thread ownership.

INFO

Thread identity determines what security permissions a thread has. Higher identity levels can access more restricted APIs.

setthreadidentity

Sets the thread's identity (context) level.

Aliases: setthreadcontext, setidentity, setthreadcaps

lua
setthreadidentity(identity: number) -> void
ParameterTypeDescription
identitynumberThe identity level to set

Example

lua
setthreadidentity(8)
-- Now running with elevated permissions
local CoreGui = game:GetService("CoreGui")
print(CoreGui:GetChildren())

getthreadidentity

Returns the current thread's identity (context) level.

Aliases: getthreadcontext, getidentity, getcontext, getthreadcaps

lua
getthreadidentity() -> number

Example

lua
print("Current identity:", getthreadidentity())
-- Typical executor identity: 8

checkcaller

Returns true if the calling thread belongs to the executor (Volcano). Useful inside hooks to differentiate between game calls and executor calls.

Aliases: isownthread

lua
checkcaller() -> boolean

Example

lua
local mt = getrawmetatable(game)
local old_namecall = mt.__namecall

setreadonly(mt, false)
mt.__namecall = newcclosure(function(self, ...)
    if not checkcaller() then
        -- This call came from the game, not from us
        local method = getnamecallmethod()
        if method == "Kick" then
            return -- Block game kicking us
        end
    end
    return old_namecall(self, ...)
end)
setreadonly(mt, true)