function onKill(cid, target)
local m = {
["CHANGE THIS TO THE MONSTER NAME"] = {
message = "Text...",
teaser = { "Teaser text.." }
cfg = {
{
deaths = 1, -- How many times the monster must die.
time = 10, -- Seconds until tp closes.
to = { x = 1000, y = 1000, z = 7 }, -- Where the tp takes you
tp = { x = 1000, y = 1000, z = 7 } -- Where the tp creates
},
}
}
}
if isPlayer(target) then
return true
end
local monster = m[getCreatureName(target)]
local check = getGlobalStorageValue(monster)
if monster then
for i = 1, #monster.cfg do
local c = monster.cfg[i]
return check >= c.deaths and c.deaths ~= 0 and setGlobalStorageValue(monster, ((c.deaths ~= nil and (check == -1 and 1) or check + 1) or -1)) and doCreatureAddHealth(monster, getCreatureMaxHealth(monster), true) and doCreatureSay(monster, monster.teaser[math.random(1, #monster.teaser)], TALKTYPE_ORANGE_1) and doCreateTeleport(c.to, c.tp) and doSendMagicEffect(c.tp, CONST_ME_TELEPORT) and addEvent(function() doRemoveItem(getTileItemById(c.tp, 1387).uid) end, c.time * 1000) or c.deaths <= 1 and doCreatureSay(cid, monster.message, TALKTYPE_ORANGE_1) and doCreateTeleport(c.to, c.tp) and doSendMagicEffect(c.tp, CONST_ME_TELEPORT) and addEvent(function() doRemoveItem(getTileItemById(c.tp, 1387).uid) end, c.time * 1000)
end
end
return true
end