onControlChange
This event is triggered when a player changes the state of a control.
Parameters
Name | Type | Description |
---|---|---|
control | keyof PlayerControls | The name of the control that has changed |
newState | boolean | The new state of the control (true for activated) |
oldState | boolean | The previous state of the control |
Example
engine.localPlayer.events.on(
'onControlChange',
(control, newState, oldState) => {
console.log(
'Control changed:',
control,
'New state:',
newState,
'Old state:',
oldState,
);
},
);
Available on: Client