Slain
TrueHavoc.com
- Joined
- Nov 27, 2008
- Messages
- 2,242
- Reaction score
- 31
I am getting a console error and dont know how to fix it :/
Here is the script.
[26/08/2009 22:10:40] Lua Script Error: [Action Interface]
[26/08/2009 22:10:40] in a timer event called from:
[26/08/2009 22:10:41] data/actions/scripts/quests/inq lever4.luanUse
[26/08/2009 22:10:41] data/actions/scripts/quests/inq lever4.lua:3: attempt to index global 'item' (a nil value)
[26/08/2009 22:10:41] stack traceback:
[26/08/2009 22:10:41] data/actions/scripts/quests/inq lever4.lua:3: in function <data/actions/scripts/quests/inq lever4.lua:1>
Here is the script.
local function back(params)
doCreateItem(params.wallid, 1, params.wallpos)
doTransformItem(params.laver, item.itemid - 1)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local corpsePos = {x=507,y=339,z=13,stackpos=1}
local corpse = getThingFromPos(corpsePos)
local corpseId = 5527
local wallPos = {x=505,y=340,z=13,stackpos=1}
local wall = getThingFromPos(wallPos)
local wallId = 1050
local time = 10
if (item.itemid == 1945 and corpse.itemid == corpseId and wall.itemid == wallId) then
doRemoveItem(corpse.uid, 1)
doRemoveItem(wall.uid, 1)
doTransformItem(item.uid, item.itemid + 1)
doPlayerSendTextMessage(cid,22,"You have three minutes to go through the portal before the wall closes!")
addEvent(back, time * 60 * 1000, {wallid = wallId, wallpos = wallPos, laver = item.uid})
elseif item.uid == 15014 and item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
end
return true
end