A lightweight example showing how to make your character carry almost any object on their shoulder. Replace the prop model, adjust the offsets, and you're ready to use it in your own scripts.
RegisterCommand('_SpawnProp', function(source, args, rawCommand)
local player = PlayerPedId()
local coords = GetEntityCoords(player)
local props = CreateObject(GetHashKey("s_guncase01"), coords.x, coords.y, coords.z, 1, 0, 1)
prop = props
SetEntityAsMissionEntity(prop,true,true)
RequestAnimDict("amb_wander@code_human_milkjug_wander@base")
while not HasAnimDictLoaded("amb_wander@code_human_milkjug_wander@base") do
Citizen.Wait(100)
end
attached = true
Citizen.InvokeNative(0xEA47FE3719165B94, player,"amb_wander@code_human_milkjug_wander@base", "base", 1.0, 8.0, -1, 31, 0, 0, 0, 0)
Citizen.InvokeNative(0x6B9BBD38AB0796DF, prop,player,GetEntityBoneIndexByName(player,"PH_L_Hand"), 0.15, 0.0, 0.5, -30.0, 0.0, -90.0, true, true, false, true, 1, true)
end)
RegisterCommand('_ClearProp', function(source, args)
ClearPedTasks(PlayerPedId())
DeleteObject(prop)
end)