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

Solved Lua Error

Exoltes

Novia OTserv Developer
Joined
Jul 2, 2009
Messages
563
Reaction score
47
Location
Belgium
I'm working on a 8.54 Open Tibia Server using The Forgotten Server - Version 0.2.7 (Mystic Spirit).

I have made the following script:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local function doTransformBack(pos, itemid, transformid)
     return doTransformItem(getTileItemById(pos, transformid).uid, itemid)
end
    if itemEx.itemid == 1744 then
        doTransformItem(itemEx.uid, 7522)
        doTransformItem({x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, itemEx.uid, 7523)
end
end
But when i execute the script in game I'm getting the following error:
[13/08/2014 11:44:53] Lua Script Error: [Action Interface]
[13/08/2014 11:44:53] data/actions/scripts/tools/crowbar.lua:eek:nUse
[13/08/2014 11:44:53] luaDoTransformItem(). Item not found

And also only the item I use my crowbar on changes and the one on pos.y+1 does not.

Anyone knows how to fix this?

Thanks in advance.
 
Try changing the second doTransformItem to doTransformBack

Not 100% sure though... Not on a computer so I can't test :/
 
Well I'm not transforming it back I'm just transforming it so there's really no point in doing that :p
The transformback line above is for when i advance my script to actually transformback the changes i made after a certain time period.
 
Is there supposed to be 3 parameters for the doTransformItem function? If so try to add "toPosition" for the first one then... Still not sure... Haha I'm just trying to help :|
 
Maybe you have just make mistake with second function name? Try changing
Code:
doTransformItem({x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, itemEx.uid, 7523)
with
Code:
doTransformBack({x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, 7522, 7523)

But I don't see sense of making two doTransformItem in one time.
 
Use getTileItemById.
Code:
doTransformItem(getTileItemById({x = toPosition.x + 1, y = toPosition.y, z = toPosition.z}, 1745).uid, 7523)
 
Back
Top