I'm need some help with this script.
As you can see a teleport will be created when Azerus is going down. I wan't it to create two teleport and a delay before the teleports a created, about 2 min should the delay be.. Im have been trying and searching but i can't really get it to work..
I tried to add "addEvent(onDeath, delay, 10000)" before " doCreateTeleport(config.teleportId, pos[1], pos[2]) " But then i just got errors in the console..
As you can see a teleport will be created when Azerus is going down. I wan't it to create two teleport and a delay before the teleports a created, about 2 min should the delay be.. Im have been trying and searching but i can't really get it to work..
I tried to add "addEvent(onDeath, delay, 10000)" before " doCreateTeleport(config.teleportId, pos[1], pos[2]) " But then i just got errors in the console..
Code:
local config = {
message = "Azerus ran into teleporter! It will disappear in 2 minutes. Enter It!",
teleportId = 1387,
bosses = { -- Monster Name, Teleport To Position, Teleport Position
["Azerus"] = { { x = 32784, y = 31169, z = 9 }, { x = 32783, y = 31177, z = 9 }},
}
}
function onDeath(cid, corpse, killer)
local position = getCreaturePosition(cid)
for name, pos in pairs(config.bosses) do
if name == getCreatureName(cid) then
doCreateTeleport(config.teleportId, pos[1], pos[2])
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
end
end
return TRUE
end