Hello good people
So, after buying Coffee from the shop, i want to have a ‘drinking coffee animation’ with a coffeecup.
Ive seen ai’s drinking from coffeecups ’ i think
This is the standard coffeecup -
'p_amb_coffeecup_01'
Atm im only drinking beer anim.
This is the code i have but, i cant seem to figure out what the PlayerAnim/Scenario is for this, so if anyone know i would appreciate it so much!
File:
\resources[legacy][esx_addons]\esx_basicneeds\client\main.lua
RegisterNetEvent('esx_basicneeds:onCoffee')
AddEventHandler('esx_basicneeds:onCoffee', function(prop_name)
if not IsAnimated then
prop_name = prop_name or 'p_amb_coffeecup_01'
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('amb@world_human_drinking@coffee@female@idle_a', function()
TaskStartScenarioInPlace(playerPed, 'world_human_drinking', 1.0, -1.0, 2000, 0, 1, true, true, true)
Citizen.Wait(3000)
IsAnimated = false
ClearPedSecondaryTask(playerPed)
DeleteObject(prop)
end)
end)
end
end)
Thanks for any reply!