isparallel
Returns whether the current thread is in parallel state.
function isparallel(): booleanSynopsis
How it works
Returns whether the current Luau thread is running inside a Parallel LuauParallel LuauRoblox's threading model that allows multiple Luau scripts to run concurrently in isolated Actor contexts. Actors have separate lua_States and can only share data through message channels. Actor context. Checks the
lua_State's associated Actor pointer:
// Pseudocode
Actor* actor = L->userdata->actor;
return actor != NULL && actor->isParallel;
When true, the thread can safely perform parallel computation but cannot access the DataModelDataModelThe root Instance in Roblox's object hierarchy (game). Contains all services (Workspace, Players, ReplicatedStorage, etc.). Teleporting destroys the current DataModel and creates a new one. directly (requires task.synchronize() first). Used to branch logic between serial and parallel code paths.Usage
Check parallel state
print(if isparallel() then "In Parallel" else "Not In Parallel")Returns
boolean True if the current lua state is in parallel phase.