• 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!

error with script, wats it mean? :O

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 :/

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

[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
 
It means the variable item has a nil (non-existant) value.


Look at your code
Code:
local function back(params)
doCreateItem(params.wallid, 1, params.wallpos)
doTransformItem(params.laver, [B][I][U]item[/U][/I][/B].itemid - 1)
end

Were do you see Item declared in that function? No where, yet your passing it as an arg. Case closed.

__________________

Are you tired of the customer neglect of TibiaBotNG? Do you think LoW needs to add more updates? Are you tired of using a crappy bot because its a cheap alternative to Elf? Well, dont be tired anymore! Check out my blog!
 
Last edited:
If you don't understand what he meant, replace:

doTransformItem(params.laver, item.itemid - 1)

with

doTransformItem(params.laver.uid, params.laver.itemid - 1)


EDIT:

You're going to also have to change your input parameters to input the item instead of just the UID.

(addEvent(back, time * 60 * 1000, {wallid = wallId, wallpos = wallPos, laver = item}))
 
If you don't understand what he meant, replace:

doTransformItem(params.laver, item.itemid - 1)

with

doTransformItem(params.laver.uid, params.laver.itemid - 1)


EDIT:

You're going to also have to change your input parameters to input the item instead of just the UID.

(addEvent(back, time * 60 * 1000, {wallid = wallId, wallpos = wallPos, laver = item}))

ty gut :D
 
Back
Top