Not sure how to stop the ped from levitating during bench press animation:
RegisterNetEvent(‘scenario’, function()
local ped = PlayerPedId()
local dict = nil
local anim = nil
local dictid = nil
local name = nil
local counter = 1
for i = 1,Config.FramesInScene,1 do
local animtaskcomplete = false
dictid = Config.Scene[i].dict
name = Config.Scene[i].name
dict = Config.Animations[dictid].animDict
anim = Config.Animations[dictid].animName[name]
if counter <= Config.FramesInScene then
while (not HasAnimDictLoaded(dict)) do
RequestAnimDict(dict)
Wait(3)
end
if HasAnimDictLoaded(dict) then
print('Animation ID ='..dict.."Animation Name ="..anim)
while not animtaskcomplete do
print("in animation loop")
TaskPlayAnim(ped, dict, anim, 3.0, 3.0, -1, 2, 0, false, false, true)
animtaskcomplete = HasEntityAnimFinished(ped,dict,anim,3)
while not animtaskcomplete do
Wait(15)
animtaskcomplete = HasEntityAnimFinished(ped,dict,anim,3)
end
end
end
end
counter = counter+1
print("counter = "..counter)
end
ClearPedTasks(ped)
end)
Here is a video of the problem: