ReferenceMulti-instance

apex.ipc.peers

Lists the other game instances on this PC that can receive messages.

Syntax

apex.ipc.peers() -> { Peer }

Returns

TypeDescription
{ Peer }Every other instance of this Apex install that is in a game right now.

Description

An instance is listed once its game has loaded and Apex can run scripts in it, and leaves the list when it leaves the game, closes or crashes. Only instances started by the same Apex install on the same PC take part; nothing goes over the network.

Each Peer is a plain table: id (a number that stays the same while the instance runs), name (the Roblox account name), displayName, userId, placeId and jobId. A Peer can be passed anywhere a target is expected, as can its id or its account name. The list is a copy: it does not change when instances join or leave. Listen for "@join" and "@leave" with apex.ipc.on to follow changes.

Example

for _, peer in apex.ipc.peers() do
    print(peer.name, peer.placeId, peer.jobId)
end

These are Game executor contracts. Check build requirements and session lifetimes before using them.