Skip to content

getthreadidentity

getthreadidentity retrieves the thread's identity of the running Luau thread.

function getthreadidentity(): number

Parameters

Parameter Description
(none) This function takes no parameters.

Example

Checking thread identity across defer
1
2
3
4
5
6
7
task.defer(function()
    setthreadidentity(2)
    print(getthreadidentity()) -- Output: 2
end)

setthreadidentity(3)
print(getthreadidentity())     -- Output: 3