mmheo
New Member
- Joined
- Sep 14, 2017
- Messages
- 157
- Reaction score
- 1
when kill monster tp don't appear no error in console
tfs 0.4
tfs 0.4
Code:
function onKill(cid, target)
local m = {
["Orc"] = {
message = "25 seconds to escape through the teleport quickly before it closes!",
cfg = {
{
time = 25, -- Seconds until tp closes.
to = {x=1131,y=1105,z=7}, -- Where the tp takes you.
tp = {x=1124,y=1100,z=7} -- Where the tp creates.
},
}
}
}
if isPlayer(target) then
return true
end
local monster = m[getCreatureName(target)]
if monster then
for i = 1, #monster.cfg do
local c = monster.cfg[i]
local function deleteTeleport()
local teleport = getTileItemById(c.tp, 1387).uid
if(teleport > 0) then
doRemoveItem(teleport)
doSendMagicEffect(c.tp, CONST_ME_POFF)
end
return true
end
doCreateTeleport(1387, c.to, c.tp)
doSendMagicEffect(c.tp, CONST_ME_ENERGYAREA)
addEvent(deleteTeleport, c.time * 1000)
end
doCreatureSay(cid, monster.message, TALKTYPE_ORANGE_1)
end
return true
end