• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Removing walls from Exhtaus

Maniucza

~Lua~ Noob
Joined
Aug 2, 2009
Messages
86
Reaction score
6
Location
Poland / Rzeszów
Hello.
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 ++ :pP
 
Please it explains as scripter functions. more I read scripter and you the very maneiro one
 
Maybe be a little more specific for new ot-players, on how to use this? That would give you alot more +rep.

Thanks anyway
 
Hello.
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 ++ :pP

well.. nice .. but.. where did u setstorage? i just can see get there.. ;x
 

Similar threads

Back
Top