kokokoko
Veteran OT User
- Joined
- Feb 4, 2008
- Messages
- 921
- Reaction score
- 257
I tried creating a teleport that should disappear after 5 seconds, but i get this error:
Here's my script:
It creates the teleport, and i get teleported when entering it. But the teleport does not disappear :blink:
Thanks in advance,
//Kokokoko
Code:
Lua Script Error: [TalkAction Interface]
in a timer event called from:
data/talkactions/scripts/teleport_town.lua:onSay
luaDoRemoveItem(). Item not found
Here's my script:
Code:
function onSay(cid, words, param, channel)
if param == "1" then
xPos = getPlayerStorageValue(cid, 5001)
yPos = getPlayerStorageValue(cid, 5002)
zPos = getPlayerStorageValue(cid, 5003)
setPlayerStorageValue(cid, 5030, 1)
elseif param == "2" then
xPos = getPlayerStorageValue(cid, 5004)
yPos = getPlayerStorageValue(cid, 5005)
zPos = getPlayerStorageValue(cid, 5006)
setPlayerStorageValue(cid, 5030, 2)
end
setPlayerStorageValue(cid, 5020, 1)
addEvent(createTeleport, 1000, cid)
end
function createTeleport(cid)
if getPlayerStorageValue(cid, 5020) == 1 then
doCreateTeleport(1387, {x=xPos, y=yPos, z=zPos}, getPlayerPosition(cid))
addEvent(removeTeleport, 1000*5, cid)
end
end
function removeTeleport(cid)
getTarget = getPlayerStorageValue(cid, 5030)
if getTarget == "1" then
xPos = getPlayerStorageValue(cid, 5001)
yPos = getPlayerStorageValue(cid, 5002)
zPos = getPlayerStorageValue(cid, 5003)
elseif getTarget == "2" then
xPos = getPlayerStorageValue(cid, 5004)
yPos = getPlayerStorageValue(cid, 5005)
zPos = getPlayerStorageValue(cid, 5006)
end
teleporterPos = {x=xPos, y=yPos, z=zPos}
getTP = getThingfromPos(teleporterPos)
doRemoveItem(getTP.uid, 1)
end
It creates the teleport, and i get teleported when entering it. But the teleport does not disappear :blink:
Thanks in advance,
//Kokokoko