[Request] Car Lock Animation

I use LockSystem script but i need car lock animation so how can i add this animation in script ?

[Release] LockSystem 3.1 (Updated the 07/16/2018) [BETA] : I use this script

[Request] Lock car animation : I need integrate this animation but how ?

This would be simple. Just need play an animation when the command/function in the other script is toggled. There’s lots of references around on hoe to play animations.

But i don’t know how can i do this

Citizen.CreateThread(function()
    local dict = "anim@mp_player_intmenu@key_fob@"
    
    RequestAnimDict(dict)
    while not HasAnimDictLoaded(dict) do
        Citizen.Wait(0)
    end

    while true do
        Citizen.Wait(0)
        if IsControlJustPressed(1, 303) then -- When you press "U"
               TaskPlayAnim(GetPlayerPed(-1), dict, "fob_click_fp", 8.0, 8.0, -1, 48, 1, false, false, false)
        end
    end
end)

Just change U to the button you use for the car lock

1 Like

which file should I add ?

Just copy paste it somewhere in the client.lua

I did it. Mission completed. Can i configure this lock animation range ?

https://runtime.fivem.net/doc/natives/#_0xEA47FE3719165B94
You should actively look for resource…

TaskPlayAnim(
	ped --[[ Ped ]], 
	animDictionary --[[ string ]], 
	animationName --[[ string ]], 
	blendInSpeed --[[ number ]], 
	blendOutSpeed --[[ number ]], 
	duration --[[ integer ]], 
	flag --[[ integer ]], 
	playbackRate --[[ number ]], 
	lockX --[[ boolean ]], 
	lockY --[[ boolean ]], 
	lockZ --[[ boolean ]]
)