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

Lua POI - Oil Error

Djowz

Djowz's Style
Joined
Dec 29, 2011
Messages
47
Reaction score
1
good people, I have a script error in the oil of POI

[25/1/2012 22:46:49] [Error - Action Interface]
[25/1/2012 22:46:49] data/actions/scripts/PitsOfInferno/Oillever.lua:eek:nUse
[25/1/2012 22:46:49] Description:
[25/1/2012 22:46:49] attempt to index a nil value
[25/1/2012 22:46:49] stack traceback:
[25/1/2012 22:46:49] [C]: in function 'getThingfromPos'
[25/1/2012 22:46:49] data/actions/scripts/PitsOfInferno/Oillever.lua:18: in function <data/actions/scripts/PitsOfInferno/Oillever.lua:7>

and here is the script

Code:
 local bridgepos = {x=32801, y=32336, z=11} -- Position of the bridge tile
  local dzwigniaPos = {x=32800, y=32339, z=11}

-- SSij pale sasir ;*  Jak chciales umiescic tu vial z olejem to gz Ci nabie ;*     Script by Seminari
local leverUID = 8933 -- Action ID of the lever

function onUse(cid, item, frompos, item2, topos)

local bridge = getThingfromPos(bridgepos)
     
	--local function removalA(dzwigniaPos)
	--if getThingfromPos(dzwigniaPos, 1946) then
	--doSetItemActionId(itemEx.uid, 52282)
	--doTransformItem(bridge.uid, 493)
	--doTransformItem(item.uid, 1945)
   -- return TRUE
  --  end
local tile5 = getThingfromPos(tilepos5)
local tilepos5 = {x=32801, y=32336, z=11, stackpos=0}
-- and bridge.itemid == 493
        if item.actionid == leverAID and item.itemid == 1945 then
		        doCreateItem(5770,1,tilepos5)
                doSendMagicEffect(dzwigniaPos, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
				--addEvent(removalA, 5 * 1000, dzwigniaPos)
       
        elseif item.actionid == leverAID and item.itemid == 1946 and bridge.itemid == 5770 then
               doPlayerSendCancel(cid, "Sorry, not possible.")
        else
                doCreatureSay(cid, "The lever is creaking and rusty.", TALKTYPE_ORANGE_1)
        end
       
        return true
end

PHP:
<action uniqueid="8933" event="script" value="PitsOfInferno/Oillever.lua"/>

Thanks in advance
hugs djowz
 
I think it's case-sensitive, it should be getThingFromPos() not getThingfromPos().
If that's not the case, then you need a stackpos.
 
Lua:
local bridgepos = {x=32801, y=32336, z=11} -- Position of the bridge tile
  local dzwigniaPos = {x=32800, y=32339, z=11}

-- SSij pale sasir ;*  Jak chciales umiescic tu vial z olejem to gz Ci nabie ;*     Script by Seminari
local leverUID = 8933 -- Action ID of the lever

function onUse(cid, item, frompos, item2, topos)

local bridge = getThingFromPos(bridgepos)
     
	--local function removalA(dzwigniaPos)
	--if getThingFromPos(dzwigniaPos, 1946) then
	--doSetItemActionId(itemEx.uid, 52282)
	--doTransformItem(bridge.uid, 493)
	--doTransformItem(item.uid, 1945)
   -- return TRUE
  --  end
local tilepos5 = {x=32801, y=32336, z=11, stackpos=0}
local tile5 = getThingFromPos(tilepos5)
-- and bridge.itemid == 493
        if item.actionid == leverAID and item.itemid == 1945 then
		        doCreateItem(5770,1,tilepos5)
                doSendMagicEffect(dzwigniaPos, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
				--addEvent(removalA, 5 * 1000, dzwigniaPos)
       
        elseif item.actionid == leverAID and item.itemid == 1946 and bridge.itemid == 5770 then
               doPlayerSendCancel(cid, "Sorry, not possible.")
        else
                doCreatureSay(cid, "The lever is creaking and rusty.", TALKTYPE_ORANGE_1)
        end
       
        return true
end

I don't know, try that
 
no more error in the executable, but the script does not work so keep getting the message: "The lever is creaking and rusty." I use the oil over the bridge does not appear.
 
that's what supposed to happen, right?

oh

Lua:
local bridgepos = {x=32801, y=32336, z=11} -- Position of the bridge tile
  local dzwigniaPos = {x=32800, y=32339, z=11}
 
-- SSij pale sasir ;*  Jak chciales umiescic tu vial z olejem to gz Ci nabie ;*     Script by Seminari
local leverAID = 8933 -- Action ID of the lever
 
function onUse(cid, item, frompos, item2, topos)
 
local bridge = getThingFromPos(bridgepos)
 
	--local function removalA(dzwigniaPos)
	--if getThingFromPos(dzwigniaPos, 1946) then
	--doSetItemActionId(itemEx.uid, 52282)
	--doTransformItem(bridge.uid, 493)
	--doTransformItem(item.uid, 1945)
   -- return TRUE
  --  end
local tilepos5 = {x=32801, y=32336, z=11, stackpos=0}
local tile5 = getThingFromPos(tilepos5)
-- and bridge.itemid == 493
        if item.actionid == leverAID and item.itemid == 1945 then
		        doCreateItem(5770,1,tilepos5)
                doSendMagicEffect(dzwigniaPos, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
				--addEvent(removalA, 5 * 1000, dzwigniaPos)
 
        elseif item.actionid == leverAID and item.itemid == 1946 and bridge.itemid == 5770 then
               doPlayerSendCancel(cid, "Sorry, not possible.")
        else
                doCreatureSay(cid, "The lever is creaking and rusty.", TALKTYPE_ORANGE_1)
        end
 
        return true
end
 
yes but when I use up the vial of oil, and use the lever that was supposed to appear over the rest of the bridge does not appear
 
Back
Top