Skip to main content

offScriptEvent

Unregister a listener function previously registered with onScriptEvent.

Syntax

engine.network.offScriptEvent(event, listener);

Parameters

NameTypeDescription
eventstringThe event name to unsubscribe.
listener(data?: NetworkEventData) => voidThe 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