Jackq
Member
- Joined
- Jul 12, 2013
- Messages
- 19
- Reaction score
- 5
Hey! I have a script that creates a tp on monsterkill and then deletes the tp after 60 sec, problem is that it works for all tps except 2,
More specefic "The Mad King" & "Charizard"
Anyone knows what the problem might be? Or any speculations?
Code:
local config = {
message = "Go into the teleport in 60 seconds, else it will disappear.",
timeToRemove = 60, -- seconds
teleportId = 1387,
bosses = { -- Monster Name, Teleport To Position, Teleport Position
["Eternal Oblivion"] = { { x = 1047, y = 346, z = 5, stackpos = 1 }, { x = 1129, y = 297, z = 11 }},
["Charizard"] = { { x = 703, y = 713, z = 7, stackpos = 1 }, { x = 636, y = 724, z = 7, stackpos = 1 }},
["Much Fire"] = { { x = 289, y = 930, z = 7, stackpos = 1 }, { x = 281, y = 929, z = 6, stackpos = 1 }},
["The Mad King"] = { { x = 1026, y = 973, z = 7, stackpos = 1 }, { x = 574, y = 1112, z = 7, stackpos = 1 }},
["The Grudge"] = { {x = 681, y = 1175, z = 4, stackpos = 1 }, {x = 713, y = 1150, z = 6, stackpos = 1 }}
}
}
local function removal(position)
if getThingfromPos(position).itemid == config.teleportId then
doRemoveItem(getThingfromPos(position).uid)
end
return TRUE
end
function onKill(cid, target, lastHit)
for name, pos in pairs(config.bosses) do
if name == getCreatureName(target) then
teleport = doCreateTeleport(config.teleportId, pos[1], pos[2])
if teleport == FALSE then
print("Create teleport failed. Check ID, position1 and position2")
return TRUE
end
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, pos[2])
end
end
return TRUE
end
Anyone knows what the problem might be? Or any speculations?
Last edited: