Advertisement
Guest User

Untitled

a guest
Feb 28th, 2019
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1.  
  2. local stoploop = 0
  3.  
  4. for iter = 1, amount do
  5.         local index = 1
  6.         for y = 1, 3 do
  7.             for x = 1, width do
  8.                 local needed_item = needed[index]
  9.                 if needed_item and stoploop == 0 then
  10.                     local craft_index = ((y - 1) * 3) + x
  11.                     local craft_item = craft_list[craft_index]
  12.                     local newitem = move_item(player_inv, craft_item, needed_item)
  13.                     if newitem then
  14.                         craft_list[craft_index] = newitem
  15.                     else
  16.                         stoploop = 1
  17.                         break
  18.                     end
  19.                 end
  20.                 index = index + 1
  21.             end
  22.         end
  23.     end
  24.  
  25.     player_inv:set_list("craft", craft_list)
  26.  
  27. unified_inventory.set_inventory_formspec(player, "craft")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement