local pos1 = {x=998, y=1021, z=7, stackpos=1}
local pos2 = {x=998, y=1032, z=7, stackpos=1}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local wall1 = getThingfromPos(pos1)
local wall2 = getThingfromPos(pos2)
if getPlayerGroupId(cid) == 4 then
if getPlayerLevel(cid) >= 100 then
if item.itemid == 9825 then
doRemoveItem(wall1.uid)
doRemoveItem(wall2.uid)
doTransformItem(item.uid, item.itemid + 1)
doBroadcastMessage("Chess!")
elseif item.itemid == 9826 then
doCreateItem(1536, pos1)
doCreateItem(1536, pos2)
doTransformItem(item.uid, item.itemid - 1)
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You need to be at least level 100 to pull this lever.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Only gamemasters can pull this lever.')
end
return TRUE
end