local cfg = {
fromPos = {1234, 1234, 7}, -- X, Y, Z - top left cornor
toPos = {1234, 1234, 7}, -- X, Y, Z - bottom right cornor
doorPos = {x = 1234, y = 1234, z = 7}, -- Door position
door_open = 1234 -- Id of the door opened. Should be a quest- or experience door.
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
for x = cfg.fromPos[1], cfg.toPos[1] do
for y = cfg.fromPos[2], cfg.toPos[2] do
for z = cfg.fromPos[3], cfg.toPos[3] do
pos = {x = x, y = y, z = z, stackpos = 253}
get = getThingPos(pos)
if isPlayer(get) then
doCreatureSay(cid, "You cant enter here, There is already another player in the room!", TALKTYPE_ORANGE_1)
else
doTransformItem(item.uid, cfg.door_open)
doTeleportThing(cid, cfg.doorPos, FALSE)
end
end
end
end
return true
end