local tpId = 1387
local tps = {
["Demon"] = {pos = {x=880, y=1313, z=7}, toPos = {x = 872, y = 1316, z = 7}, time = 60}
["Cyclops"] = {pos = {x=695, y=1209, z=7}, toPos = {x = 673, y = 1219 , z = 7}, time = 60}
}
function onKill(cid, target, lastHit)
local monster = getCreatureName(target)
if tps[monster] then
doCreateTeleport(tpId, tps[monster].toPos, tps[monster].pos)
doCreatureSay(cid, "Good job, leave this area in ".. tps[monster].time .." seconds.", TALKTYPE_ORANGE_1)
addEvent(removeTp, tps[monster].time*1000, tps[monster].pos)
end
return true
end
function removeTp(pos)
local position = {x=pos.x,y=pos.y,z=pos.z,stackpos=0}
for i=1, 255 do
position.stackpos = i
local tile = getTileThingByPos(pos)
if tile.itemid == tpId then
doRemoveItem(tile.uid)
end
end
return true
end
Fiz assim, mas esse erro ta aparecendo:
cannot open ...Tpkill...
} expected <to close { at line 2) near [
achei muito estranho pq na segunda linha não tem nenhum [