• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[8.5] [Action] Teleport scroll, need help. Event error

Moj mistrz

Monster Creator
Joined
Feb 1, 2008
Messages
932
Solutions
10
Reaction score
295
Location
Poland
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.

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.
[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.lua:eek:nUse

[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>
Thanks for help.
 
Back
Top