Ir para conteúdo

Como Arruma Esse Bug?


Strubol

Posts Recomendados

Troca a função spawnNewZombie na lib por essa:

 

function spawnNewZombie()
	local posx = {}
	local posy = {}
	local posz = {}
	local pir = {}
	for i=1, 5 do
			local posx_tmp = math.random(math.min(ZE_spawnFromPosition.x ,ZE_spawnToPosition.x), math.max(ZE_spawnFromPosition.x ,ZE_spawnToPosition.x))
			local posy_tmp = math.random(math.min(ZE_spawnFromPosition.y ,ZE_spawnToPosition.y), math.max(ZE_spawnFromPosition.y ,ZE_spawnToPosition.y))
			local posz_tmp = math.random(math.min(ZE_spawnFromPosition.z ,ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z ,ZE_spawnToPosition.z))
			local pir_tmp = 0
			local spec = getSpectators({x=posx_tmp, y=posy_tmp, z=posz_tmp}, 3, 3, false)
			if(spec and #spec > 0) then
					for z, pid in pairs(spec) do
							if(isPlayer(pid)) then
									pir_tmp = pir_tmp + 1
							end
					end
			end
			posx[i] = posx_tmp
			posy[i] = posy_tmp
			posz[i] = posz_tmp
			pir[i] = pir_tmp
	end
	local lowest_i = 1
	for i=2, 5 do
			if(pir[i] < pir[lowest_i]) then
					lowest_i = i
			end
	end
	local ret = (type(doCreateMonster("Zombie Event", {x=posx[lowest_i], y=posy[lowest_i], z=posz[lowest_i]}, false)) == 'number')
	if(ret) then
			addZombiesCount()
	end
	return ret
end

Editado por Demonbholder
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...