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

how i can modify this action? easy to scripters

fernandon

New Member
Joined
Feb 16, 2008
Messages
22
Reaction score
0
How to put a delay, after an X time the wall will reappear again consequently the lever also back



how do I change this?

Code:
local pos = {
    [2025] = {x = 1023, y = 1204, z = 11},
    [2026] = {x = 1025, y = 1204, z = 11},
    [2027] = {x = 1027, y = 1204, z = 11},
    [2028] = {x = 1029, y = 1204, z = 11}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(item.itemid == 1945) then
        doRemoveItem(getTileItemById(pos[item.uid], 6289).uid, 1)
        doSendMagicEffect(pos[item.uid], CONST_ME_FIRE)
    else
        doCreateItem(6289, 1, pos[item.uid])
        doSendMagicEffect(pos[item.uid], CONST_ME_FIRE)
            return true
    end
 
    if (item.itemid == 1945) then
        doTransformItem(item.uid, item.itemid + 1)
    else
        doTransformItem(item.uid, item.itemid - 1)
    end
 
    return true
end



else, someone has the action on the part of the holy tible in the pits of inferno (second part of quest) ?
 
Code:
local pos = {
  [2025] = {id = 2601,wall = x = 1023, y = 1204, z = 11},
  [2026] = {id = 2601,wall = x = 1025, y = 1204, z = 11},
  [2027] = {id = 2601,wall = x = 1027, y = 1204, z = 11},
  [2028] = {id = 2601,wall = x = 1029, y = 1204, z = 11}
}

local time_to_return = 5 -- in seconds
function onUse(cid, item, fromPosition, itemEx, toPosition)
  if(item.itemid == 1945) then
  doRemoveItem(getTileItemById(pos[item.uid].wall, 6289).uid, 1)
  doSendMagicEffect(pos[item.uid].wall, CONST_ME_FIRE)
     doTransformItem(item.uid, item.itemid + 1)
     addEvent(function()
       if not getTileItemById(pos[item.uid], 6289).uid then
         doCreateItem(pos[item.uid].id, 1 , pos[item.uid].wall)
         doTransformItem(item.uid, 1945)
       end
       return true
     end,time_to_return*1000)
  end
  return true
end
 
Should transform item to 0 instead of removing the wall. Anything placed on map cannot be removed unless using transform to 0
 
Code:
local pos = {
  [2025] = {id = 2601,wall = x = 1023, y = 1204, z = 11},
  [2026] = {id = 2601,wall = x = 1025, y = 1204, z = 11},
  [2027] = {id = 2601,wall = x = 1027, y = 1204, z = 11},
  [2028] = {id = 2601,wall = x = 1029, y = 1204, z = 11}
}

local time_to_return = 5 -- in seconds
function onUse(cid, item, fromPosition, itemEx, toPosition)
  if(item.itemid == 1945) then
  doRemoveItem(getTileItemById(pos[item.uid].wall, 6289).uid, 1)
  doSendMagicEffect(pos[item.uid].wall, CONST_ME_FIRE)
     doTransformItem(item.uid, item.itemid + 1)
     addEvent(function()
       if not getTileItemById(pos[item.uid], 6289).uid then
         doCreateItem(pos[item.uid].id, 1 , pos[item.uid].wall)
         doTransformItem(item.uid, 1945)
       end
       return true
     end,time_to_return*1000)
  end
  return true
end


I tested did not work, =(
 
Back
Top