Moj mistrz
Monster Creator
Hi, i need help with that script. It is working, but when time is over teleport wont remove. Down ill give ya script and error in console.
ERROR.
local function deleteTeleport()
local tp = getTileItemById(position, 1387).uid
doSendMagicEffect(position, CONST_ME_POFF)
doRemoveItem(tp)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = { x=2395, y=1904, z=7 }
local tpTime = 30
local position = { x=2395, y=1906, z=7 }
doCreateTeleport(tpID, pos, position)
doSendMagicEffect(position, CONST_ME_MAGIC_GREEN)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have ".. tpTime .." seconds until the portal
will disapear.")
doPlayerSay(cid, "You have ".. tpTime .." seconds until the portal will disapear.",
TALKTYPE_ORANGE_1)
addEvent(deleteTeleport, tpTime * 1000)
doRemoveItem(item.uid,1)
return TRUE
end
ERROR.
Thanks for help.[05/12/2009 22:00:37] Lua Script Error: [Action Interface]
[05/12/2009 22:00:37] in a timer event called from:
[05/12/2009 22:00:37] data/actions/scripts/teleport.luanUse
[05/12/2009 22:00:37] attempt to index a nil value
[05/12/2009 22:00:37] stack traceback:
[05/12/2009 22:00:37] [C]: in function 'getTileItemById'
[05/12/2009 22:00:38] data/actions/scripts/teleport.lua:2: in function <data/actions/scripts/teleport.lua:1>