emitToPlayers
Emit an event to all players on the server.
Syntax
engine.network.emitToPlayers(event, data);
Parameters
Name | Type | Description |
---|---|---|
event | string | The event name to emit. |
data (optional) | NetworkEventData | The event data. |
Example
engine.network.emitToPlayers('onOpenDoor', {
doorId: 1,
status: true,
});
Available on: Client Server