DRW Posted April 23, 2015 Share Posted April 23, 2015 addEventHandler("onPlayerDamage",root, function(attacker, weapon) if weapon == 8 and getElementType ( source ) ~= "ped" then killPed(source,attacker,weapon) end end) I want to make slothman's zombies die when they get hit by a specific weapon, but I don't know how, I've tried googling and looking at the MTA Wiki but nothing works. Link to comment
Walid Posted April 23, 2015 Share Posted April 23, 2015 Try to use this addEventHandler("onPlayerDamage",root, function(attacker, weapon) if weapon == 8 and getElementType ( source ) == "ped" then if (getElementData (source, "zombie") == true) then killPed(source,attacker,weapon) end end end) Link to comment
DRW Posted April 23, 2015 Author Share Posted April 23, 2015 Try to use this addEventHandler("onPlayerDamage",root, function(attacker, weapon) if weapon == 8 and getElementType ( source ) == "ped" then if (getElementData (source, "zombie") == true) then killPed(source,attacker,weapon) end end end) Not working... Link to comment
Enargy, Posted April 24, 2015 Share Posted April 24, 2015 try this addEventHandler("onPlayerDamage",root, function(attacker, weapon) if getElementType(source) == "player" then if type(attacker) == "ped" then if ( getPedWeapon(attacker) == 8 and getElementData (source, "zombie") == false ) then killPed(source, attacker, weapon) outputChatBox("true", source) end end end end) Link to comment
ALw7sH Posted April 24, 2015 Share Posted April 24, 2015 onPlayerDamage Called only when player dmaged You have to use onClientPedDamage instead 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