local config = {
wall_pos = {x = 11111, y = 11111, z = 11, stackpos = 1}, -- these have the same position
creature_pos = {x = 11111, y = 11111, z = 11, stackpos = 253}, -- but different stack position
door_id = 1111,
wall_id = 1111
}
function onUse(cid, item, frompos, item2, topos)
local getThing = getThingfromPos(config.wall_pos)
local getCreature = getThingfromPos(config.creature_pos)
if item.itemid == 1945 then
doTransformItem(item.uid, item.itemid + 1)
doTransformItem(getThing.uid, door_id)
elseif item.itemid == 1946 then
doTransformItem(item.uid, item.itemid - 1)
doTransformItem(getThing.uid, wall_id)
if isCreature(getCreature.uid) == TRUE then
doMoveCreature(getCreature.uid, SOUTH)
end
end
return true
end