hi guys, i make zombie/player can kill other player by stealth but for first trying this its working fine but after idk why its work but don't do sealthkill anim, and how check if someone back of player ?, any help ?
--CHECKS FOR ZOMBIE GRABBING FROM BEHIND
function setZombieBitten (ped, target)
if (isElement(ped)) and (exports["ZA-export"]:isPedZombie(ped)) and not (isPedDead(ped)) then
if (isElement(target)) and not (exports["ZA-export"]:isPedZombie(target)) and not (isPedInVehicle(target)) then
local tx,ty,tz = getElementPosition(ped)
local vx,vy,vz = getElementPosition(target)
local zombdistance = getDistanceBetweenPoints3D(tx, ty, tz, vx, vy, vz)
if (zombdistance < 0.8 ) and (getElementType(target) == "player") and not (isPedDead(target)) then
triggerClientEvent("onZombieControl", ped, "moan", math.random(moanlimit))
if (getElementType(ped) == "ped") then
triggerClientEvent("onZombieControl", ped, "stop")
end
return killPed(target, ped, 0, 4, true)
end
end
end
return false
end