Thank you, Gamesnert. That was my mistake. I used getLocalPlayer. But now that I use getRootElement, the script just pushes peds, and doesn't pop them.
This is the code that executes the push n' pop:
function onStreamIn ( )
local tipo = getElementType ( source )
if tipo == "ped" then
table.insert ( zombies, source )
outputConsole ( "STACK PUSH!" )
end
end
function onStreamOut ( )
local tipo = getElementType ( source )
if tipo == "ped" then
table.remove ( zombies, source )
outputConsole ( "STACK POP!" )
end
end
addEventHandler( "onClientElementStreamIn", getRootElement(), onStreamIn )
addEventHandler( "onClientElementStreamOut", getRootElement(), onStreamOut )
Can't see anything wrong with it.