setplayercontrols script command is used to enable or disable player input. Disabling the player controls prevents any player input including moving, casting spells, using items or interacting with the HUD in any way. It hides the cursor but otherwise does not hide the HUD, which must be done separately via the
When the player controls is disabled, all spells cast by the player are cancelled as well as any Night vision (), Levitate (), Speed () and Flying eye () spells cast on the player. All NPCs are notified asynchronously via the
controls_on event when disabling or enabling the controls respectively.
setplayercontrols off/on does not send any events and does not cancel any spells if the controls are already disabled.
Turning of player input also pauses the players natural regeneration as well as damage from poison and starvation. Additionally, the
specialfx heal command has no effect while the player input is disabled.
||Enable or disable player input|