How to Allow Movement While Handcuffed in FiveM
Want handcuffed players to move around in FiveM without losing realism? Our friendly guide walks you through easy code tweaks for QBCore, ESX, and vRP, enabling movement while keeping the unwanted act
Guide: Allowing Movement While Handcuffed (FiveM) In role‑play servers with FiveM, handcuffs add a touch of realism and tension. Many players discover that the default freezing behavior can be too restrictive, making the experience feel artificial. This guide shows you how to let players move while handcuffed across all popular frameworks—QBCore, ESX, and vRP—while still preventing the most obvious actions like shooting or driving. ---
Understanding the handcuffing flow
When a player is cuffed, the server toggles three client-side things: the handcuff animation plays (mp_arresting/idle), SetEnableHandcuffs flips the cuffed-state flag, and the entity is usually frozen with FreezeEntityPosition to lock the player in place. To let players walk while cuffed, unfreeze the entity but keep the offensive-action controls disabled via DisableControlAction on a continuous client thread. The exact line to change depends on your framework — covered below for QBCore scripts, ESX scripts, and vRP. ---
QBCore Framework (and QBOX) – Step‑by‑Step
1. Find the Handcuff Code
Search the police job or utility scripts for the cue that triggers handcuffing. It normally looks like: ```lua TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0) SetEnableHandcuffs(playerPed, true) FreezeEntityPosition(playerPed, true) ```
2. Enable Movement
Replace the freeze call: ```lua FreezeEntityPosition(playerPed, false) -- Allows free walking ``` Your updated snippet becomes: ```lua TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0) SetEnableHandcuffs(playerPed, true) FreezeEntityPosition(playerPed, false) ```
3. Keep Controls Restricted
Create a continuous thread that disables the potentially problematic actions: ```lua Citizen.CreateThread(function() while true do Citizen.Wait(10) if IsHandcuffed then DisableControlAction(0, 24, true) -- Attack DisableControlAction(0, 25, true) -- Aim DisableControlAction(0, 142, true) -- MeleeAttackAlternate DisableControlAction(0, 75, true) -- Leave Vehicle DisableControlAction(0, 92, true) -- Shoot in vehicle end end end) ``` Replace `IsHandcuffed` with the variable that indicates the do‑handcuff state for your specific script. ---
ESX Framework – How to Do It
1. Locate the Main Handcuff Section
Find `esx_policejob/client/main.lua` and locate the following code: ```lua TaskPlayAnim(playerPed, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0) SetEnableHandcuffs(playerPed, true) SetPedCanPlayGestureAnims(playerPed, false) FreezeEntityPosition(playerPed, true) ```
2. Remove the Freeze
Change `FreezeEntityPosition(playerPed, true)` to `false` so that walking is possible.
3. Disable Key Controls
Implement a similar thread to keep weapons and vehicle controls at bay: ```lua Citizen.CreateThread(function() while true do Citizen.Wait(10) if IsHandcuffed then DisableControlAction(0, 142, true) -- MeleeAttackAlternate DisableControlAction(0, 30, true) -- MoveLeftRight DisableControlAction(0, 31, true) -- MoveUpDown DisableControlAction(0, 24, true) -- Shoot DisableControlAction(0, 92, true) -- Shoot in car DisableControlAction(0, 75, true) -- Leave Vehicle end end end) ``` Be sure to link `IsHandcuffed` to your ESX handcuff flag. ---
vRP – Customizing Movement
1. Find the Handcuff Declaration
The core logic often resides in `vrp/modules/police.lua` or a custom resource. Look for: ```lua vRPclient.playAnim(player, {true, {{mp_arresting, idle}}, true}) vRPclient.setHandcuffed(player, true) vRPclient.setFreeze(player, true) ```
2. Unfreeze for Movement
Swap the freeze line: ```lua vRPclient.setFreeze(player, false) ```
3. Lock Specific Actions
Insert or modify a client script to continuously disable undesired controls: ```lua Citizen.CreateThread(function() while true do Citizen.Wait(10) if IsHandcuffed then DisableControlAction(0, 24, true) -- Attack DisableControlAction(0, 25, true) -- Aim DisableControlAction(0, 142, true) -- MeleeAttackAlternate DisableControlAction(0, 75, true) -- Leave Vehicle DisableControlAction(0, 92, true) -- Shoot in vehicle DisableControlAction(0, 30, true) -- Move Left/Right DisableControlAction(0, 31, true) -- Move Up/Down end end end) ```
4. Sync the Handcuff Flag
Define a global variable and listen for a server‑side event: ```lua local IsHandcuffed = false RegisterNetEvent('vrp:handcuff') AddEventHandler('vrp:handcuff', function(status) IsHandcuffed = status end) ``` Trigger this event whenever a player is handcuffed or released. ---
Final considerations
Test on a staging server before pushing live — police-script changes are one of the easiest ways to brick an arrest flow on a busy night. Audit your final DisableControlAction list against the official control reference so you don't accidentally re-enable shooting or vehicle entry. If your server uses QBCore or ESX, pin to a specific release tag and document the patch in your repo so future framework upgrades don't silently revert this change.