offScriptEvent
Unregister a listener function previously registered with onScriptEvent
.
Syntax
engine.network.offScriptEvent(event, listener);
Parameters
Name | Type | Description |
---|---|---|
event | string | The event name to unsubscribe. |
listener | (data?: NetworkEventData) => void | The listener to remove from the event subscription. |
Example
// subscribe
const listener = engine.network.offScriptEvent('onDoorOpen', player => {
// ...
});
// unsubscribe
engine.network.offScriptEvent('onDoorOpen', listener);
Available on: Client Server