• 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!

Lua Zombie

Majeski20

New Member
Joined
Apr 21, 2008
Messages
602
Reaction score
4
Location
Sweden
EDITED!

Hello! :)

I'm so close to get zombie event to work. It's just this bug!
Zombies do not kill you, they hit you to 0 hp but u are not dead? And if i walk with 0 hp to the teleport to temple.
I died because thats not the arena area.

Please help me!

Code:
local temple =  {x=1000, y=1000, z=7}

local t = {
	items = {11234, 11237, 11238, 2514, 2472, 2470, 7405, 7453, 7431, 6433, 2542, 6391, 3972, 8918, 5903},
	exp = 10000000
}
local config = {
	arena = {
		frompos = {x = 1131, y = 913, z =7},
		topos = {x = 1161, y = 930, z=7}
	}
}

function onPrepareDeath(cid, deathList)
if (isInRange(getCreaturePosition(cid), config.arena.frompos, config.arena.topos)) then
	if (isMonster(deathList[1]) and isPlayer(cid)) then
		if (getCreatureName(deathList[1]) == "Deadly Zombie") then
			if #getPlayersfromArea(config.arena.frompos, config.arena.topos) == 1 then
				doTeleportThing(cid, temple)
				doSendMagicEffect(getCreaturePosition(cid),10)
				doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Congratulations, you won! Enjoy your reward!")
			doBroadcastMessage("Congratulations! ".. getCreatureName(cid) .." won Deadly Zombie arena event! This event is over, next event after approximately 2 hours.", MESSAGE_EVENT_ADVANCE)
				doCreatureAddHealth(cid, getCreatureMaxHealth(cid), CONST_ME_MAGIC_BLUE, TEXTCOLOR_BLUE, true)
				local v = math.random(1, 15)
				if v < 15 then
					doPlayerAddItem(cid, t.items[math.random(#t.items)], 1)
				else
					doPlayerAddExp(cid, t.exp)
				end
			else
				doTeleportThing(cid, temple)
				doSendMagicEffect(getCreaturePosition(cid),10)
				doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You got owned!")
			doBroadcastMessage("".. getCreatureName(cid) .." got owned and was kicked from arena.", MESSAGE_EVENT_ADVANCE)
				doCreatureAddHealth(cid, getCreatureMaxHealth(cid), CONST_ME_MAGIC_BLUE, TEXTCOLOR_BLUE, true)
				return false
			end
		end
		
	elseif isPlayer(deathList[1]) and isPlayer(cid) and isInRange(getCreaturePosition(cid), config.arena.frompos, config.arena.topos) then
		doTeleportThing(cid, temple)
		doSendMagicEffect(getCreaturePosition(cid),10)
		doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You got owned by playa!")
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid), CONST_ME_MAGIC_BLUE, TEXTCOLOR_BLUE, true)
		return false
	end
else
return true
end
	return false
end


login.lua
Code:
	registerCreatureEvent(cid, "onPrepareDeath")
	registerCreatureEvent(cid, "deadlyArena")

creaturescript.xml
<event type="preparedeath" name="deadlyArena" event="script" value="deadlyArena.lua"/>
 
Last edited:
the problem is that there is no item with id 1387 in:

x=1005, y=1002, z=7

try changing
Code:
local TilePos = {x=1005, y=1002, z=7}
to either
Code:
local TilePos = {x=1005, y=1002, z=7, stackpos = 1}
OR
Code:
local TilePos = {x=1005, y=1002, z=7, stackpos = 2}

im not sure.. try both..
 
Back
Top