I got a problem, im trying to make a script that creates a bridge when pulling the lever and that works perfect. It's like a hidde quest, so it creates a bridge over to an island and i want if you are on that island when the "lever function" resets i want the player/players to teleport out of it.
Here is my code:
I'm getting these two errors:
Here is my code:
Lua:
local addpos = {x=1040, y=1016, z=8, stackpos=1}
local lavaone = 4809
local lavatwo = 4811
local lavathree = 598
local tele = {
a = {x =1039, z =1016, y =8},
b = {x =1039, z =1015, y =8},
c = {x =1041, z =1016, y =8}
}
function onUse(cid, item, fromPos, item2, toPos)
if item.itemid == 1945 then
doCreateItem(1284,1,{x=1040, y=1016, z=8})
doRemoveItem(getThingfromPos(stonepos).uid, 1)
doRemoveItem(getThingfromPos(stonepos).uid, 1)
doPlayerSendTextMessage(cid,22,"You heard a noise to the north-west")
doTransformItem(item.uid,1946)
addEvent(onTimer5, 10*1000)
end
return true
end
function onTimer5()
doTransformItem(getThingFromPos({x=1049, y=1023, z=8, stackpos=1}).uid, 1945)
doRemoveItem(getThingfromPos(stonepos).uid, 1)
doCreateItem(lavaone,1,{x=1040, y=1016, z=8})
doCreateItem(lavatwo,1,{x=1040, y=1016, z=8})
doCreateItem(lavathree,1,{x=1040, y=1016, z=8})
if isInArea(getPlayerPosition(cid), tele.a, tele.b) then
doTeleportThing(cid,tele.c)
end
end
I'm getting these two errors:
Code:
[Error - Action Interface]
In a timer event called from:
data/actions/scripts/custom/hiddenquest.lua:onUse
Description:
data/lib/032-position.lua:2: attempt to index local 'position' <a boolean value>
-------------
stack traceback:
data/lib/032-position.lua:2: in function 'isInArea'
..ta/actions/scripts/custom/hiddenquest.lua:29: in function <...ta/actions/scripts/custom/hiddenquest.lua:23: