Advertisement
Guest User

craft

a guest
Jan 21st, 2014
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. local craftTable = {
  2.     [9808] = {2464, 2465, 2483, 2463, 2476, 8891, 2487,2466, 2492, 2472}
  3.     }
  4.    
  5. function onUse(cid, item, fromPosition, itemEx, toPosition)
  6. local pos = {x = 1934, y = 1989, z = 8}
  7.    
  8.         if getTileItemById(pos, itemEx.uid) > 0 then
  9.             if doRemoveItem(getTileItemById(pos, itemEx.uid), 1) then
  10.            
  11.                 if item.itemid == 9825 then
  12.                 doTransformItem(item.uid, 9826)
  13.                 elseif item.itemid == 9826 then
  14.                 doTransformItem(item.uid, 9825)
  15.                 end
  16.                
  17.                 local craftedItem = craftTable[itemEx.itemid][math.random(#craftTable[itemEx.itemid])]
  18.                 doPlayerAddItem(cid, craftedItem)
  19.                 return true
  20.             end
  21.         end
  22.     doPlayerSendTextMessage(cid,MESSAGE_EVENT_ORANGE,"Wrong item on table.")
  23.     return true
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement