• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Mappers pls read two questions

Felipe93

Ghost Member
Joined
Mar 21, 2015
Messages
2,035
Solutions
9
Reaction score
361
Location
Chile
How i can make a switch could open door or make appears teleports?

how i can add more than 1 item in a chest? (quest)

im using avesta 7.4

thanks
 
door switch:
Code:
-- Coordinates of the door
local doorPos = {x=1, y=1, z=1}

-- IDs of closed and open door
local doorClosed = 1209
local doorOpen = 1211

function onUse(cid, item, frompos, item2, topos)
   if (item.itemid == 1945) then -- Opening door, switch flipped to left
     doTransformItem(getTileItemById(doorPos, doorClosed).uid, doorOpen)

     doTransformItem(item.uid, 1946)
   elseif (item.itemid == 1946) then -- Closing door, switch flipped to right
  local nextTile = {x=doorPos.x + 1, y=doorPos.y, z=doorPos.z}
  doRelocate(doorPos, nextTile) -- Move all movable items or creatures 1 SQM east

     doTransformItem(getTileItemById(doorPos, doorOpen).uid, doorClosed)

     doTransformItem(item.uid, 1945)
   end

   return true
end
teleport switch:
Code:
-- Coordinates for creating the teleport
local tpCreate = {x=1, y=1, z=1}
-- Destination of the teleport
local tpDest = {x=1, y=1, z=1}

-- IDs of teleport
local tpID = 1387

function onUse(cid, item, frompos, item2, topos)
   if (item.itemid == 1945) then -- Creating teleport, switch flipped to left
  local nextTile = {x=tpCreate.x, y=tpCreate.y + 1, z=tpCreate.z}
  doRelocate(tpCreate, nextTile) -- Move all movable items or creatures 1 SQM south

     doCreateTeleport(tpID, tpDest, tpCreate)

     doTransformItem(item.uid, 1946)
   elseif (item.itemid == 1946) then -- Closing door, switch flipped to right
     doRemoveItem(getTileItemById(tpCreate, tpID).uid)

     doTransformItem(item.uid, 1945)
   end

   return true
end
 
Back
Top