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