Forkz
Well-Known Member
- Joined
- Jun 29, 2020
- Messages
- 380
- Solutions
- 1
- Reaction score
- 89
Hi,
I am using the system below to create teleportation when the "monster" is over and I would like it to show the time that teleportation will close.
Example:
I am using the system below to create teleportation when the "monster" is over and I would like it to show the time that teleportation will close.
Example:
Lua:
local tps = {
["Abomination Fury"] = {pos = {x=1835, y=980, z=11}, toPos = {x=2135, y=1066, z=9}, time = 300},
["Orshabaal"] = {pos = {x=1835, y=980, z=11}, toPos = {x=2135, y=1066, z=9}, time = 300}
}
local function removeTp(tp)
local t = getTileItemById(tp.pos, 1387).uid
return t > 0 and doRemoveItem(t) and doSendMagicEffect(tp.pos, CONST_ME_POFF)
end
function onDeath(cid)
local tp = tps[getCreatureName(cid)]
if tp then
doCreateTeleport(1387, tp.toPos, tp.pos)
doCreatureSay(cid, "O teleport irá sumir em "..tp.time.." segundos.", TALKTYPE_ORANGE_1)
addEvent(removeTp, tp.time*1000, tp)
end
return true
end