• 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!

Lever teleport on use

Change TALKTYPE to whatever suits you
@grekftw

Lua:
local item_required = 1111
local item_count = 1
local destination = Position(1000,1000,7)

function onUse(cid, item, fromPosition, itemEx, toPosition)

   -- check if lever is currently used
   if item.itemid == 1946 then
       player:say("Wait for switch to reset.",TALKTYPE_MONSTER_SAY)
       return false
   end

   -- check if player has item
   if not player:removeItem(item_required,item_count) then
       player:say("You do not have the required item to use this lever.",TALKTYPE_MONSTER_SAY)
       return false
   end

   -- remove item, transform lever, and add reset
   player:teleportTo(destination,true)
   item:transform(1946)
   addEvent(function() item:transform(1945) end, 10 * 1000)
   return true
end
 
Change TALKTYPE to whatever suits you
@grekftw

Lua:
local item_required = 1111
local item_count = 1
local destination = Position(1000,1000,7)

function onUse(cid, item, fromPosition, itemEx, toPosition)

   -- check if lever is currently used
   if item.itemid == 1946 then
       player:say("Wait for switch to reset.",TALKTYPE_MONSTER_SAY)
       return false
   end

   -- check if player has item
   if not player:removeItem(item_required,item_count) then
       player:say("You do not have the required item to use this lever.",TALKTYPE_MONSTER_SAY)
       return false
   end

   -- remove item, transform lever, and add reset
   player:teleportTo(destination,true)
   item:transform(1946)
   addEvent(function() item:transform(1945) end, 10 * 1000)
   return true
end

Thank you Pox
 
Back
Top