Skip to main content

onControlChange

This event is triggered when a player changes the state of a control.

Parameters

NameTypeDescription
controlkeyof PlayerControlsThe name of the control that has changed
newStatebooleanThe new state of the control (true for activated)
oldStatebooleanThe 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