AcediaDocumentation

getthreadcaps

Returns the current thread's 64-bit capability bitmask as a hex string.

Reads the 64-bit capability bitmask from the thread's Roblox context block beside its identity and returns it as a fixed-width hex string, formatted as 0x followed by 16 lowercase hex digits.

Returned as text rather than a number because the mask uses up to 62 bits, which does not round-trip through a Lua number (double).

getthreadcaps(): string

Example

local caps = getthreadcaps()
print(caps)

local function hasBit(caps, bit)
    local word = tonumber(string.sub(caps, bit < 32 and -8 or 3, bit < 32 and -1 or 10), 16) or 0
    return bit32.band(word, bit32.lshift(1, bit % 32)) ~= 0
end

Example output

0x300000000000000b

The specific value depends on the identity under which the thread is running; the shape is always 0x plus 16 lowercase hex digits.

On this page