Notorious^ Posted March 20, 2018 Posted March 20, 2018 addEvent "onPlayerHeadshot" addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if bodypart == 9 then local result = triggerEvent("onPlayerHeadshot", source, attacker, weapon, loss) if result == true then killPed(source, attacker, weapon, bodypart) end end end ) Hello Guys You know this is basic headshot script.but ı want add dead animation when he dying with headshot ? which can ı add some stuff ? can you help me ?
Saml1er Posted March 21, 2018 Posted March 21, 2018 You can use setPedAnimation setTimer Call setPedAnimation to play animation instead of killPed, and then set the timer to kill the ped. This will kill the ped when animation is over.
KaMi Posted March 21, 2018 Posted March 21, 2018 23 hours ago, Notorious^ said: addEvent "onPlayerHeadshot" addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if bodypart == 9 then local result = triggerEvent("onPlayerHeadshot", source, attacker, weapon, loss) if result == true then killPed(source, attacker, weapon, bodypart) end end end ) Hello Guys You know this is basic headshot script.but ı want add dead animation when he dying with headshot ? which can ı add some stuff ? can you help me ? addEvent "onPlayerHeadshot" addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if bodypart == 9 then local result = triggerEvent("onPlayerHeadshot", source, attacker, weapon, loss) if result == true then setPedAnimation(source, "anim", "anim") setTimer ( function() killPed(source, attacker, weapon, bodypart) end, 1000, 1 ) --here you can change the time when the player going to die. end end end )
Captain Cody Posted March 29, 2018 Posted March 29, 2018 @Notorious^ Next time be patient, don't flip out due to no response.
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