xuaNN Posted December 17, 2018 Share Posted December 17, 2018 (edited) Firstly, sorry for my bad english. I don't know it very well. Hello all, i wanna add a animation on fire with rifle. When the gun is fired, the animation will start. How can i do this? I wrote a few lines of code, but it didn't work. local ped = getLocalPlayer() local weaponid = getPedWeapon(ped) addEventHandler( "onWeaponFire", root, function reload () if weaponid == 33 then setPedAnimation(ped,"buddy","buddy_crouchreload") end end I understood the mistake I made. Topic deleted. Clientside: local ped = getLocalPlayer() -- Get Player local weaponid = getPlayerWeapon(ped) -- Get Players weapon. function reload () if weaponid == 33 then -- if player weapon is rifle setPedAnimation(ped,"buddy","buddy_crouchreload") -- Set ped animation end end addEventHandler("onClientPlayerWeaponFire",root,reload) -- if player fire with weapon get function reload It can work. Edited December 17, 2018 by xuaNN Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now