for i=1, #ShopClerk do
local distance = GetDistanceBetweenCoords(ShopClerk[i].x, ShopClerk[i].y, ShopClerk[i].z, GetEntityCoords(GetPlayerPed(-1)))
if distance < 6 then
if (PlayingAnim == false) then
TaskPlayAnim(ShopClerk[i].id,"random@shop_gunstore","_greeting", 1.0, -1.0, 4000, 0, 1, true, true, true)
PlayingAnim = true
Citizen.Wait(4000)
else
TaskPlayAnim(ShopClerk[i].id,"random@shop_gunstore","_idle_b", 1.0, -1.0, -1, 0, 1, true, true, true)
end
else
TaskPlayAnim(ShopClerk[i].id,"random@shop_gunstore","_idle_b", 1.0, -1.0, -1, 0, 1, true, true, true)
--PlayingAnim = false
end
end
animation stop but i canât replay animation when iâm going away and coming again (because playinganims not set to false)
When I put it on false, this made a loop.
yes, animation stop when iâm further way, When the duration is set to 0, the animation is not played.
ClearPedTasks() does absolutly nothing