Advertisement
Guest User

ad

a guest
Feb 9th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. do tick() end
  2. local Mathf = require(game.ServerScriptService.Mathf)
  3.  
  4. Mathf.mult(15,5)
  5. Mathf.mult(13,5)
  6.  
  7. local Pages={}
  8. local Rows={}
  9. local Blocks={}
  10. local RowsPerPage = 5
  11. local BlocksPerRow = 5
  12. local BlocksPerPage = 25
  13.  
  14. local Inventory = script.Parent.Inventory.Main
  15.  
  16. function LoadBlock(item, img, yOffset)
  17. local block = Inventory.temp.template:Clone()
  18. block.Parent = Inventory
  19. block.Image.Image = img
  20. block.Name = item
  21. if #Blocks>=1 and #Blocks ~= Mathf.mult(#Blocks,5) then
  22. block.Position = Blocks[#Blocks].Position + UDim2.new(0,100,0,yOffset)
  23. else
  24. block.Position = UDim2.new(0,0,0,yOffset)
  25. end
  26. block.Visible = true
  27. table.insert(Blocks,block)
  28. return block
  29. end
  30.  
  31.  
  32. function LoadRow(row_num,yOffset)
  33. for i=1,BlocksPerRow do
  34. LoadBlock("block","rbxassetid://28003293",yOffset)
  35. end
  36. end
  37.  
  38.  
  39. function LoadPage()
  40. for i=1,RowsPerPage do
  41. print(#Rows)
  42. if #Rows>=1 then
  43. LoadRow(#Rows+1,#Rows*100)
  44. table.insert(Rows,#Rows+1)
  45. else
  46. table.insert(Rows,1)
  47. LoadRow(1,0)
  48. end
  49. end
  50. end
  51.  
  52. LoadPage()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement