• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help In Zombie

hesham15

New Member
Joined
Feb 11, 2011
Messages
94
Reaction score
1
how do i make zombie attack players inside zombie arena event without if zombie touch player. player get teleported to temple.

i want to make players are able to block zombie inside the arena and the event continue normaly
 
hesham15 u want to edit this part
Lua:
function onStatsChange(target, cid, changetype, combat, value)
	if((cid and isMonster(cid) and getCreatureName(cid) == "zombie") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then
		doCreatureAddHealth(target, getCreatureMaxHealth(target))
		loseOnZombieArena(target)
		return false
	end
	return true
end
 
Lua:
function loseOnZombieArena(cid)
	kickPlayerFromZombiesArea(cid)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You Are Losser!")
	local players = getZombiesEventPlayers()
	if(#players <= 1) then
		local winner = players[1]
		if(winner) then
		    doPlayerAddItem(winner, 2160, 10, true)
			doPlayerSendTextMessage(winner, MESSAGE_STATUS_CONSOLE_BLUE, "You Won Zombie Event.")
			doBroadcastMessage("After " .. os.time() - getPlayerZombiesEventStatus(winner) .. " Seconds Of Fight " .. getCreatureName(winner) .. " Won Zombie Event Versus " .. getStorage(ZE_ZOMBIES_SPAWNED) .. " Zombie.")
			kickPlayerFromZombiesArea(winner)
		end
		doSetStorage(ZE_STATUS, 0)
		doSetStorage(ZE_PLAYERS_NUMBER, ZE_DEFAULT_NUMBER_OF_PLAYERS)
		doSetStorage(ZE_ZOMBIES_TO_SPAWN, 0)
		doSetStorage(ZE_ZOMBIES_SPAWNED, 0)
		local width = (math.max(ZE_spawnFromPosition.x, ZE_spawnToPosition.x) - math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)) / 2 + 1
		local height = (math.max(ZE_spawnFromPosition.y, ZE_spawnToPosition.y) - math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)) / 2 + 1
		local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z}
		for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do
			centerPos.z = z
			for i, uid in pairs(getSpectators(centerPos, width, height, false)) do
				if(isMonster(uid)) then
					doRemoveCreature(uid)
				end
			end
		end
	end
end

function onStatsChange(target, cid, changetype, combat, value)
	if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then
		doCreatureAddHealth(target, getCreatureMaxHealth(target))
		loseOnZombieArena(target)
		return false
	end
	return true
end
 
Back
Top