Skip to main content
Shows you all Actors a game has, so it can run code on one.
Shows you all Actors a game has, so it can run code on one.
The table is a plain array, so getactors()[1] is the first actor. Hand one of them to run_on_actor to run code on that thread.

Returns

{Actor} - an array of every Actor instance currently in the game. The array is empty when the game has no actors.

Example

Grab the first actor in the game and run a script on it.
Not every Roblox game has actors. Many developers rarely create an Actor, so getactors returns an empty table - check it has an entry before indexing.
The table is a plain array, so getactors()[1] is the first actor. Hand one of them to run_on_actor to run code on that thread.

Returns

{Actor} - an array of every Actor instance currently in the game. The array is empty when the game has no actors.

Example

Grab the first actor in the game and run a script on it.
Not every Roblox game has actors. Many developers rarely create an Actor, so getactors returns an empty table - check it has an entry before indexing.