Jump to content

Zombies spawning in anti zombie zone


ArcAngeL

Recommended Posts

Hi Community

My codes make sense.when zombies hit the zone they dying but zombies still spawning and 2 seconds later dying in anti zombie zone.ı stuck to it!ı have seen some topics like this,but problems are not solved. what can ı do for disable zombie spawn in these zone ? someone help me ?  ı took screenshot :https://pasteboard.co/I5Owj3n.png

 


zones = {
{ 1102.84851, -2076.73242, 50.39820, 140.31323242188, 86.654296875, 38.136251831055},
{ 93.98439, 1797.64380, 10.64063, 183.03248596191, 143.92370605469, 25.82357254028},
{253.78212, 660.28491, -100.31984, 553.6088104248, 391.908203125, 132.129859352112},
{-2099.59644, -282.63025, 33.46355, 89.87451171875, 206.22969055176, 34.355757141113},
}	


for i,v in pairs(zones) do
  local x, y, z, width, height, depth = unpack(zones[i]) 
	col = createColCuboid ( x, y, z, width, height, depth)
	setElementData(col, "zombieProof", true)
end	

addEventHandler("onColShapeHit", root,
function(hiter)
	if getElementData(source,"zombieProof") == true and getElementType(hiter) == "ped" then
		if getElementData(hiter, "zombie") then
			destroyElement(hiter)
		end
	end
end)

 

Link to comment

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...