Skip to content

Carry

The client-side Carry global manages attaching a ped to the player with mode-specific bone offsets and animations. Use it for handcuffing, rescuing, or dragging scenarios. Never call AttachEntityToEntity directly for these cases — Carry handles animation loading, bone alignment, and automatic cleanup.

Three Modes

ModeDescription
carryPlayer holds the ped in their arms (over-the-shoulder)
escortPlayer walks alongside the ped, hand on shoulder
dragPlayer drags the ped along the ground behind them

Starting a Carry

lua
Carry.start(targetPed, mode)
lua
-- Carry an incapacitated ped
Carry.start(targetPed, 'carry')

-- Escort a handcuffed player
Carry.start(targetPed, 'escort')

-- Drag an unconscious ped
Carry.start(targetPed, 'drag')

mode defaults to 'carry' if not provided.

Stopping a Carry

lua
Carry.stop()

Detaches the ped, clears animations on both the player and target, and emits carry:stopped.

Checking State

lua
Carry.isActive()    -- boolean — is a carry currently active?
Carry.getTarget()   -- integer|nil — entity handle of the carried ped
Carry.getMode()     -- string|nil — 'carry' | 'escort' | 'drag'

Events

Carry emits EventBus events you can subscribe to from any module:

EventPayloadWhen
carry:started{ ped, mode }A carry begins
carry:stopped{ ped, mode }A carry ends
lua
EventBus.on('carry:started', function(data)
    -- e.g. restrict player movement speed
end)

EventBus.on('carry:stopped', function(data)
    -- e.g. restore movement speed
end)

Safety Monitor

Carry runs a background thread that checks every 500ms whether the target ped still exists. If the entity is destroyed (player disconnects, ped deleted), Carry.stop() is called automatically.

Full Example — Handcuff System

lua
-- Server: tell the target's client to enter carry state
TriggerClientEvent('net:mymodule:beingCarried', targetSource, GetPlayerPed(playerSource))

-- Target client handler
AddEventHandler('net:mymodule:beingCarried', function(carrierPed)
    -- disable controls while being carried
    CreateThread(function()
        while Carry.isActive() do
            DisableAllControlActions(0)
            Wait(0)
        end
    end)
end)

-- Carrier client: start escort
Carry.start(GetPlayerPed(targetSource), 'escort')

-- When done
Carry.stop()

API Reference

MethodDescription
Carry.start(targetPed, mode?)Begin carrying the target ped in the given mode
Carry.stop()Release the target ped and clear animations
Carry.isActive()Returns true if a carry is currently active
Carry.getTarget()Returns the entity handle of the carried ped, or nil
Carry.getMode()Returns the current mode string, or nil

Client-only

Carry is a client-side global. It is not available in server scripts.

See Also

Released under the MIT License.