emitToScripts
Emit an event to all scripts on the server.
note
If this method is called on the client, it will only emit the event to the local scripts.
Syntax
engine.network.emitToScripts(event, data);
Parameters
Name | Type | Description |
---|---|---|
event | string | The event name to emit. |
data | NetworkEventData | The event data. (optional) |
Example
engine.network.emitToScripts('onOpenDoor', {
doorId: 1,
status: true,
});
Available on: Client Server