TorNix~|nR Posted August 4, 2016 Share Posted August 4, 2016 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 ) Link to comment
Bonus Posted August 4, 2016 Share Posted August 4, 2016 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 Link to comment
Moderators IIYAMA Posted August 5, 2016 Moderators Share Posted August 5, 2016 Doesn't have the event onZombieSpawn a source element? Also clean your table... 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