Advertisement
Uissu

[X-TIBIA][ACTION] Create Teleport with Lever

Feb 5th, 2012
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. function doRemoveItemByIdAndPos(itemid, pos, count) -- By Byerne XTibia
  2.     local itempos, c = pos, 0
  3.     for stackpos=1,255 do
  4.         itempos.stackpos, i = stackpos, getThingFromPos(itempos)
  5.         if i.itemid == itemid then
  6.             doRemoveItem(i.uid, i.type)
  7.             if (count and count == c) then
  8.                 break
  9.             end
  10.         end
  11.     end
  12. end
  13.  
  14. function onUse(cid, item, frompos, item2, topos) -- By Byerne XTibia
  15.     local itempos, itemid, i, newpos = {x=000, y=000, z=0}, 1387, getThingfromPos(itempos), {x=000, y=000, z=0}
  16.     if item.itemid == 1945 then
  17.         doRemoveItemByIdAndPos(itemid, itempos)
  18.     elseif item.itemid == 1946 then
  19.         doCreateTeleport(itemid, newpos, itempos)
  20.     end
  21.     doTransformItem(item.uid,item.itemid == 1945 and 1946 or 1945)
  22. return true
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement