• 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 Removing a wall.

SoloQ

Hard With Style
Joined
Mar 12, 2009
Messages
557
Reaction score
21
Location
Netherlands ;3
Hi guys,

I am trying to make my poi work so for the lava walls you encounter I made this:

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cfg = {
		p = {
			wall_ = { x = 32831, y = 32333, z = 11 }, -- Where the wall is.
			lever = { x = 32820, y = 32321, z = 10 } -- Where the lever is.
		},
		wall_id = 6289, -- Wall item id.
	}
	if(item.itemid == 1945) then
			doCreateItem(cfg.wall_id, 1, p.wall_) and doTransformItem(getTileItemById(p.lever, 1946).uid, 1945) end
		end
	elseif(item.itemid == 1946) then
	return doRemoveItem(getTileItemById(p.wall_, cfg.wall_id).uid) and doTransformItem(getTileItemById(h.lever, 1945).uid, 1946)
	end
	return true
end


Error in console is : unexpected symbol near 'and'

Helpzzzz

-Hansie
 
Last edited:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)    
local cfg = {
        p = {
            wall_ = { x = 32831, y = 32333, z = 11 }, -- Where the wall is.
            lever = { x = 32820, y = 32321, z = 10 } -- Where the lever is.
        },
        wall_id = 6289 -- Wall item id.
    }
    if(item.itemid == 1945) then
        doCreateItem(cfg.wall_id, 1, cfg.p.wall_)
        doTransformItem(getTileItemById(cfg.p.lever, 1946).uid, 1945) 
    elseif(item.itemid == 1946) then
        doRemoveItem(getTileItemById(cfg.p.wall_, cfg.wall_id).uid) 
        doTransformItem(getTileItemById(cfg.p.lever, 1945).uid, 1946)
    end
    return true
end
 
Last edited:
end is to much after doTransformItem(getTileItemById(p.lever, 1946).uid, 1945) as you use elseif..
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)    
local cfg = {
        p = {
            wall_ = { x = 32831, y = 32333, z = 11 }, -- Where the wall is.
            lever = { x = 32820, y = 32321, z = 10 } -- Where the lever is.
        },
        wall_id = 6289 -- Wall item id.
    }
    if(item.itemid == 1945) then
        doCreateItem(cfg.wall_id, 1, cfg.p.wall_)
        doTransformItem(getTileItemById(cfg.p.lever, 1946).uid, 1945) 
    elseif(item.itemid == 1946) then
        doRemoveItem(getTileItemById(cfg.p.wall_, cfg.wall_id).uid) 
        doTransformItem(getTileItemById(cfg.p.lever, 1945).uid, 1946)
    end
    return true
end


New error in console: Error-action interface data/actions/script/quests/poi_lever_1.lua:eek:nUse Description: Luainterface::luaDoTransformItem> Item not found
 
Using your script I cannot use the lever. it gives that error, simply stating that it doesn't find the item its supposed to transform in I think
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local cfg = {
        p = {
            wall_ = { x = 32831, y = 32333, z = 11 }, -- Where the wall is.
            lever = { x = 32820, y = 32321, z = 10 } -- Where the lever is.
        },
        wall_id = 6289 -- Wall item id.
    }
    if(item.itemid == 1945) then
        doCreateItem(cfg.wall_id, 1, cfg.p.wall_)
        doTransformItem(item.uid, 1945) 
    elseif(item.itemid == 1946) then
        doRemoveItem(getTileItemById(cfg.p.wall_, cfg.wall_id).uid) 
        doTransformItem(item.uid, 1946)
    end
    return true
end
 
Is there a lever on the lever pos? Does it have the correct id?
Try changing getTileItemById id and transformTo id maybe.
 
Tested,

ingame: Sorry, not possible.

Console: Nothing

@summ

19:37 Your current position is [X: 32820 | Y: 32321 | Z: 10]

this is when standing on the lever.
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)local cfg = {
        wall_ = { x = 32831, y = 32333, z = 11 }, -- Where the wall is.
        --lever = { x = 32820, y = 32321, z = 10 }, -- Where the lever is.
        wall_id = 6289 -- Wall item id.
    }
    if(item.itemid == 1945) then
        doCreateItem(cfg.wall_id, 1, cfg.wall_)
        doTransformItem(item.uid, 1945) 
    elseif(item.itemid == 1946) then
        doRemoveItem(getTileItemById(cfg.wall_, cfg.wall_id).uid) 
        doTransformItem(item.uid, 1946)
    end
    return true
end

i cant work very well cus i cant test it, i'm almost doin this in a cloud
 
Lol :p
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cfg = {
        wall_ = {x = 32831, y = 32333, z = 11}, -- Where the wall is.
        wall_id = 6289 -- Wall item id.
    }
    if(item.itemid == 1945) then
        doCreateItem(cfg.wall_id, 1, cfg.wall_)
        doTransformItem(item.uid, 1946) 
    elseif(item.itemid == 1946) then
        doRemoveItem(getTileItemById(cfg.wall_, cfg.wall_id).uid) 
        doTransformItem(item.uid, 1945)
    end
    return true
end
 
Tested it again, no console errors but it did not work.

Try this shit:

Lua:
----------No reason why this should be inside the script. Doesn't break anything but bugs me.------------
local cfg = {
     wall_id = 6289, -- Wall item id
     ["pos"] = {
          wall = { x = 32831, y = 32333, z = 11 }, -- Where the wall is.
          lever = { x = 32820, y = 32321, z = 10 }, -- Where the lever is.
          },
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(item.itemid == 1945) then
        doCreateItem(cfg.wall_id, cfg["pos"].wall)
        doTransformItem(item.uid, 1945) 
    elseif(item.itemid == 1946) then
        doRemoveItem(getTileItemById(cfg["pos"].wall, cfg.wall_id).uid) 
        doTransformItem(item.uid, 1946)
    end
    return true
end

Limos works too I think lol.
 
I did a quick test for any typos, and it worked fine for me (TFS 0.3.6). Are you sure the position is correct and do you start without wall and lever id 1945? or with wall and lever id 1946?
Also added it correctly in actions.xml?
 
Back
Top