Jump to content

zombie blips


TorNix~|nR

Recommended Posts

Posted

Hi everyone, I have a zombie blips script! but I have little problem, I made that when Zombie is dead, the blip destroyed!

and it do not work can anyone help please?

 blips = { } 
  
addEvent ( "onZombieSpawn", true ) 
addEventHandler ( "onZombieSpawn", root, 
function ( ) 
for _, v in ipairs ( getElementsByType ( "ped" ) ) do 
if getElementData ( v, "zombie" ) then 
if ( not blips [ v ] ) then 
blips [ v ] = createBlipAttachedTo ( v, 0, 1, 255, 0, 0, 150, 0, 500) 
end 
end 
end 
end 
) 
  
addEvent ( "onPedWasted", true ) 
addEventHandler ( "onPedWasted", root, 
function ( ) 
if ( isElement ( blips [ source ] ) ) then 
destroyElement ( blips [ source ] ) 
end 
end 
)  

Posted

Maybe the blip is only getting created again because of onZombieSpawn?

Try to ask there, if the ped is dead:

if getElementData ( v, "zombie" ) and not isPedDead ( v ) then 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...