• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua DoTransformItem - item not found

Komigz

New Member
Joined
May 27, 2013
Messages
9
Reaction score
0
Location
Poland
Hello
I have problem with script.
When i use the lever item 11449 transform to 11448, but after 20 seconds item 11448 don't transfer to 11449 and i have an error in console:

Code:
 [09/09/2013 14:17:59] Lua Script Error: [Action Interface]
[09/09/2013 14:17:59] in a timer event called from:
[09/09/2013 14:17:59] data/actions/scripts/quests/wrathOfTheEmperorQuestLights.lua:onUse
[09/09/2013 14:17:59] LuaScriptInterface::luaDoTransformItem(). Item not found
[09/09/2013 14:17:59] stack traceback:
[09/09/2013 14:17:59]    [C]: at 0x013f987a70

My script
Code:
    elseif(item.uid == 3172) then
        if(getGlobalStorageValue(8019) < 1) then
            setGlobalStorageValue(8019, 1)
            addEvent(setGlobalStorageValue, 20 * 1000, 8019, 0)
            pos = {x = 2092, y = 1535, z = 8}
            doTransformItem(getTileItemById(pos, 11449).uid, 11448)
            addEvent(doTransformItem, 20 * 1000, getTileItemById(pos, 11448).uid, 11449)

anyone know how to fix it?
thanks
 
Code:
local pos = {x = 2092, y = 1535, z = 8, stackpos = 1} -- you need to use stackpos 1 in this case so it changes the first item above ground on that position
doTransformItem(getThingFromPos(pos).uid, 11448)
edit:
same with the addEvent
Code:
addEvent(doTransformItem, 20 * 1000, getThingFromPos(pos).uid, 11449)
 
Last edited:
Still no working :/

edit

Code:
[09/09/2013 14:44:06] Lua Script Error: [Action Interface]
[09/09/2013 14:44:06] data/actions/scripts/quests/wrathOfTheEmperorQuestLights.lua:onUse
[09/09/2013 14:44:06] .../actions/scripts/quests/wrathOfTheEmperorQuestLights.lua:31: attempt to call global 'getThingFromPos' (a nil value)
[09/09/2013 14:44:06] stack traceback:
[09/09/2013 14:44:06]    [C]: in function 'getThingFromPos'
[09/09/2013 14:44:06]    .../actions/scripts/quests/wrathOfTheEmperorQuestLights.lua:31: in function <.../actions/scripts/quests/wrathOfTheEmperorQuestLights.lua:1>
 
try this then
Code:
local pos = {x = 2092, y = 1535, z = 8, stackpos = 1}
doTransformItem(getThingfromPos(pos).uid, 11448)
addEvent(doTransformItem, 20 * 1000, getThingfromPos(pos).uid, 11449)

if you still have errors, then post the error message
 
Last edited:
Still have errors,

[09/09/2013 14:53:19] Lua Script Error: [Action Interface]
[09/09/2013 14:53:19] data/actions/scripts/quests/wrathOfTheEmperorQuestLights.lua:onUse
[09/09/2013 14:53:19] .../actions/scripts/quests/wrathOfTheEmperorQuestLights.lua:20: attempt to call global 'getThingFromPos' (a nil value)
[09/09/2013 14:53:19] stack traceback:
[09/09/2013 14:53:19] [C]: in function 'getThingFromPos'
[09/09/2013 14:53:19] .../actions/scripts/quests/wrathOfTheEmperorQuestLights.lua:20: in function <.../actions/scripts/quests/wrathOfTheEmperorQuestLights.lua:1>
 
Back
Top