How to use only a certain part of animation
-
Hi, i want to use a certain part of animation for my mod, for example i have an animation that is long 10 second and i want to start from the 6 second and skip the first part, how can do this? Thank to all, sorry for my really bad english.
-
Play the animation then use SET_ENTITY_ANIM_CURRENT_TIME to set where you want it to start.
-
Thank you, I'm trying to write a simple lua script, but it doesn't work(execute the entire animation), please can you help me?
this is the code:local baf = {}
local ad = "anim@arena@celeb@flat@solo@no_props@" local anim = "flip_a_player_a"
function baf.tick()
local ped = PLAYER.GET_PLAYER_PED(-1)
if (CONTROLS.IS_CONTROL_PRESSED(2,44) and CONTROLS.IS_CONTROL_PRESSED(2,23)) then
baf.loadAnimDict(ad) PLAYER._SET_MOVE_SPEED_MULTIPLIER(ped, 1.25) AI.TASK_PLAY_ANIM(ped, ad, anim, 8.0, 1.0, -1, 32, 0, false, false, false) ENTITY.GET_ENTITY_ANIM_CURRENT_TIME(ped, ad, anim) ENTITY.SET_ENTITY_ANIM_CURRENT_TIME(ped, ad, anim, 0.4) AI.STOP_ANIM_TASK(ped, ad, anim, 0.7)
end
endfunction baf.loadAnimDict(dict)
while( not STREAMING.HAS_ANIM_DICT_LOADED(dict)) do
STREAMING.REQUEST_ANIM_DICT(dict)
wait(50)
endend
return baf