Maniucza
~Lua~ Noob
Hello.
I present to you remove the wall with the lever from exhtaus.
Well, we start :
Data/actions/scripts/wallexh.lua
Data/actions/actions.xml
Well, please, and welcome coments )
REP ++ P
I present to you remove the wall with the lever from exhtaus.
Well, we start :
Data/actions/scripts/wallexh.lua
Code:
local exh = 5
local storage = 1414
function onUse(cid, item, frompos, item2, topos)
local switchs =
{
[2000] = {{x=160, y=91, z=8, stackpos=1}, 1497},
[2001] = {{x=161, y=90, z=8, stackpos=1}, 1497}
}
if(getPlayerStorageValue(cid,storage) <= os.time()) then
if(not switchs[item.uid]) then
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
return TRUE
end
local pos = switchs[item.uid][1]
local wall = getThingfromPos(pos)
if(wall.itemid == switchs[item.uid][2]) then
doRemoveItem(wall.uid, 1)
doTransformItem(item.uid, item.itemid+1)
else
doCreateItem(switchs[item.uid][2], 1, pos)
doTransformItem(item.uid, item.itemid-1)
end
return TRUE
end
Data/actions/actions.xml
Code:
<action itemid="1945" script="wallexh.lua" />
<action itemid="1946" script="wallexh.lua" />
Well, please, and welcome coments )
REP ++ P