function onUse(cid, item, topos, frompos)
local wallID, pos, push = 1022, {x=1000, y=1000, z=7}, {x=1000, y=1001, z=7}
if item.itemid == 1945 then
doRemoveItem(1000, 1)
doTransformItem(item.uid, 1946)
elseif item.itemid == 1946 then
doTransformItem(item.uid, 1945)
doRelocate(pos, push)
doCreateItem(wallID, 1, pos)
end
return TRUE
end
function onUse(cid, item, topos, frompos)
local wallID, pos, push = 1022, {x=1000, y=1000, z=7}, {x=1000, y=1001, z=7}
if item.itemid == 1945 then
doRemoveItem(1000, 1) << What is the 1000? the unique id? and if so then it removes the item but only once
doTransformItem(item.uid, 1946)
elseif item.itemid == 1946 then
doTransformItem(item.uid, 1945)
doRelocate(pos, push)
doCreateItem(wallID, 1, pos)
end
return TRUE
end
function onUse(cid, item, topos, frompos)
local cfg = {
wallPos = {x=1000, y=1000, z=7, stackpos=1},
wallPush = {x=1000, y=1001, z=7}, -- Relocate creature/item to this Pos if it blocks wallPos
wallId = 1022
}
if item.itemid == 1945 then
doRemoveItem(getThingfromPos(cfg.wallPos).uid)
doTransformItem(item.uid, 1946)
elseif item.itemid == 1946 then
doRelocate(cfg.wallPos, cfg.wallPush)
doCreateItem(cfg.wallId, 1, cfg.wallPos)
doTransformItem(item.uid, 1945)
end
return TRUE
end