Im using this for smoking but player ped is taking the cigarette to the left hand but animation of the smoking is doint with right hand can somone help me for a better animation or can i change the hand of this cigarette object?
RegisterNetEvent('esx_basicneeds:sigara')
AddEventHandler('esx_basicneeds:sigara', function(prop_name)
if not IsAnimated then
prop_name = prop_name or 'ng_proc_cigarette01a'
IsAnimated = true
Citizen.CreateThread(function()
local playerPed = PlayerPedId()
local x,y,z = table.unpack(GetEntityCoords(playerPed))
local prop = CreateObject(GetHashKey(prop_name), x, y, z + 0.2, true, true, true)
local boneIndex = GetPedBoneIndex(playerPed, 18905)
AttachEntityToEntity(prop, playerPed, boneIndex, 0.12, 0.028, 0.001, 10.0, 175.0, 0.0, true, true, false, true, 1, true)
ESX.Streaming.RequestAnimDict('switch@michael@smoking', function()
TaskPlayAnim(playerPed, 'switch@michael@smoking', 'michael_smoking_loop', 1.0, -1.0, 2000, 0, 1, true, true, true)
Citizen.Wait(5000)
TaskPlayAnim(playerPed, 'switch@michael@smoking', 'michael_smoking_loop', 1.0, -1.0, 2000, 0, 1, true, true, true)
Citizen.Wait(5000)
TaskPlayAnim(playerPed, 'switch@michael@smoking', 'michael_smoking_loop', 1.0, -1.0, 2000, 0, 1, true, true, true)
Citizen.Wait(5000)
TaskPlayAnim(playerPed, 'switch@michael@smoking', 'michael_smoking_loop', 1.0, -1.0, 2000, 0, 1, true, true, true)
Citizen.Wait(5000)
TaskPlayAnim(playerPed, 'switch@michael@smoking', 'michael_smoking_loop', 1.0, -1.0, 2000, 0, 1, true, true, true)
Citizen.Wait(5000)
TaskPlayAnim(playerPed, 'switch@michael@smoking', 'michael_smoking_loop', 1.0, -1.0, 2000, 0, 1, true, true, true)
Citizen.Wait(5000)
IsAnimated = false
ClearPedSecondaryTask(playerPed)
DeleteObject(prop)
end)
end)
end
end)