• 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 Click switch, remove wall.

WaderoS

New Member
Joined
Nov 22, 2008
Messages
98
Reaction score
1
Script on switch & wall
In my spare time I wrote this script.

Description script:
Use the switch and it push the wall disappears automatically after 2minutes this wall back.

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)  
    wall_pos = {x=617, y=647, z=12, stackpos=1}  
    wall = getThingfromPos(wall_pos)  
  
        if item.itemid == 1945 and wall.itemid == 1034 then 
            doSendMagicEffect(wall_pos, 10)  
                doRemoveItem(wall.uid, 1)  
                doTransformItem(item.uid, 1946)  
            addEvent(createWall, 3 * 1000)  
        elseif item.itemid == 1946 then
            doTransformItem(item.uid, 1945)  
        else
            doPlayerSendCancel(cid,"Sorry, not possible.")
        end  
    return TRUE 
end  
  
function createWall()   
    doCreateItem(1034, wall_pos) 
    doSendMagicEffect(wall_pos, 10) 
end
 
Last edited:
you dont need createWall function -.-

but the script its nice :)
 
If I spam the lever it will end up creating walls over walls....... :)
 
I think if else its declaring what the 1945 its nil then with all itemids do this: doTransformItem(item.uid, 1945)
 
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)  
    wall_pos = {x=617, y=647, z=12, stackpos=1}  
    wall = getThingfromPos(wall_pos)  
  
        if item.itemid == 1945 and wall.itemid == 1034 then 
            doSendMagicEffect(wall_pos, 10)  
                doRemoveItem(wall.uid, 1)  
                doTransformItem(item.uid, 1946)  
            addEvent(createWall, 3 * 1000)  
        elseif item.itemid == 1946 then
            doTransformItem(item.uid, 1945)  
        else
            doPlayerSendCancel(cid,"Sorry, not possible.")
        end  
    return TRUE 
end  
  
function createWall()   
    doCreateItem(1034, wall_pos) 
    doSendMagicEffect(wall_pos, 10) 
end
 
Code:
local stonepos = {x=535, y=1266, z=10, stackpos=1} -- Stone pos
function onUse(cid, item, fromPos, item2, toPos)
    if item.itemid == 1945 then
        doRemoveItem(getThingfromPos(stonepos).uid, 1)
        doTransformItem(item.uid,1946)
        addEvent(onTimer5, 2*60*1000) --2minutes
    end
return true
end

function onTimer5() --creates wall back
    doTransformItem(getThingFromPos({x=535, y=1251, z=10, stackpos=1}).uid, 1945)--lever pos
    doCreateItem(1304,1,{x=535, y=1266, z=10})-- Stone pos
end
 
Back
Top