Hey
iw got this script thats supposed to make a tp to s specific place whene killed. But when it get killed theres no teleport and no errows.... cane someone lock at my scripts and tell me if im mission something?
code in creaturescript
and the script...
am i missing something?
iw got this script thats supposed to make a tp to s specific place whene killed. But when it get killed theres no teleport and no errows.... cane someone lock at my scripts and tell me if im mission something?
code in creaturescript
Code:
<event type="kill" name="CreateTeleport" script="createteleport.lua"/>
and the script...
Code:
local config = {
["text"] = {time = 60, toPos = {x = 671, y = 963, z = 7}, tpPos = {x = 671, y = 966, z = 7}}
}
local function deleteTeleport(tp)
local teleport = getTileItemById(tp, 1387).uid
if(teleport > 0) then
doRemoveItem(teleport)
doSendMagicEffect(tp, CONST_ME_POFF)
end
return true
end
function onKill(cid, target)
local monster = config[getCreatureName(target):lower()]
if(isPlayer(target) or not monster) then
return true
end
doCreateTeleport(1387, monster.toPos, monster.tpPos)
doCreatureSay(cid, "You have "..monster.time.." seconds to enter the teleport!", TALKTYPE_ORANGE_1)
addEvent(deleteTeleport, monster.time * 1000, monster.tpPos)
return true
end
am i missing something?