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

Solved Lever dont erase the wall.

kubiczi123

RoFT- First and last memb
Joined
Dec 30, 2011
Messages
101
Reaction score
11
Location
Poland
Hi, its again me.
I have next problem and i hope you will help me ;)

I have one lever that should remove this wall:


Lever:


Actions.xml
PHP:
	<action uniqueid="4181" event="script" value="lever.lua"/>

Lever.lua
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)  
    wall_pos = {x=1157, y=1119, z=8, 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

What should i do to make this wall disappear?

#Edit: I'm using pokemon centurion engine

#EDIT2: I've noticed that bug in lever.lua (wrong pos)
And it didnt worked at all
 
Change:
XML:
<action uniqueid="4181" event="script" value="lever.lua"/>

to:
XML:
<action actionid="4181" event="script" value="lever.lua"/>
 
It's still not working. I'm doing right the rest?

btw i cant even press the lever. It says its imposible
 
Last edited:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)  
	local wallpos = {x=1157, y=1119, z=8, stackpos=1}  
	local wallchk = getThingfromPos(wallpos)
        local itemID = 1946  
        if item.itemid == 1945 and wallchk.itemid == 1034 then
            doSendMagicEffect(wallchk,10)  
            doRemoveItem(wallchk.uid,1)  
            doTransformItem(item.uid,item.itemid+1)  
            addEvent(onTimer5, 3 * 1000)  
        elseif item.itemid == 1946 then
            doTransformItem(item.uid, 1945)  
        else
            doPlayerSendCancel(cid,"Sorry, not possible.")
        end  
    return TRUE 
end  

function onTimer5()
wallnewpos = {x=1157, y=1119, z=8} 
		doCreateItem(1034,1,wallnewpos)
end
 
Back
Top