DogeGalaxy

OPFC

Oct 20th, 2018
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.15 KB | None | 0 0
  1. local gui = game:GetObjects("rbxassetid://01354696646")[1]
  2. gui.Parent = game.CoreGui
  3.  
  4. --PlayerList
  5. print("Broken Chapter ;) by DaddySauce")
  6. local players = game:GetService("Players")
  7. local frame = gui.UI.Players.List
  8. local slots = frame
  9. local temp = gui.UI.Topbar.Template
  10.  
  11. local players_table = {}
  12.  
  13. local dir = "Out"
  14. local style = "Quad"
  15. local dur = 0.5
  16.  
  17. local function cleanup(slot)
  18.  
  19. repeat
  20. wait()
  21. until slot.Position.X.Offset == 100
  22. slot:Destroy()
  23.  
  24. end
  25.  
  26. local function remove(leaving)
  27.  
  28. if leaving then
  29.  
  30. players_table[leaving] = nil
  31.  
  32. local slot = slots:FindFirstChild(leaving)
  33. slot:TweenPosition(UDim2.new(0, 100, 0, slot.Position.Y.Offset), dir, style, dur, true)
  34.  
  35. local cor = coroutine.wrap(cleanup)
  36. cor(slot)
  37.  
  38. end
  39. end
  40.  
  41. local function add()
  42.  
  43. local chil = players:GetChildren()
  44. for c = 1, #chil do
  45.  
  46. if players_table[chil[c].Name] == nil then
  47.  
  48. players_table[chil[c].Name] = 1
  49.  
  50. local slot = temp:Clone()
  51. slot.Visible = true
  52. slot.Name = chil[c].Name
  53. slot.Text = slot.Name
  54. slot.Parent = slots
  55. slot.MouseButton1Click:connect(function()
  56. gui.UI.Players.Player.Text = slot.Text
  57. gui.UI.Players.Avatar.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=150&y=200&Format=Png&username="..slot.Text
  58. gui.UI.Players.Age.Text = "Age: "..game.Players[slot.Text].AccountAge
  59. gui.UI.Players.UserId.Text = "UserID: "..game.Players[slot.Text].UserId
  60. end)
  61. end
  62. end
  63. end
  64.  
  65. local function adjust(leaving)
  66.  
  67. add()
  68. remove(leaving)
  69.  
  70. local count = 0
  71. for key, value in pairs(players_table) do
  72. count = count + 1
  73. local slot = slots:FindFirstChild(key)
  74. local ypos = 10 + (20+2)*(count-1)
  75. print(count)
  76. if count > 5 then
  77. gui.UI.Players.List.CanvasSize = UDim2.new(0, 0, 1.5, 0)
  78. end
  79. if count > 6 then
  80. gui.UI.Players.List.CanvasSize = UDim2.new(0, 0, 1.7, 0)
  81. end
  82. if count > 7 then
  83. gui.UI.Players.List.CanvasSize = UDim2.new(0, 0, 1.9, 0)
  84. end
  85. if count > 8 then
  86. gui.UI.Players.List.CanvasSize = UDim2.new(0, 0, 2.1, 0)
  87. end
  88. if count > 9 then
  89. gui.UI.Players.List.CanvasSize = UDim2.new(0, 0, 2.3, 0)
  90. end
  91. if count > 10 then
  92. gui.UI.Players.List.CanvasSize = UDim2.new(0, 0, 2.5, 0)
  93. end
  94. if count > 11 then
  95. gui.UI.Players.List.CanvasSize = UDim2.new(0, 0, 2.7, 0)
  96. end
  97. end
  98. end
  99.  
  100. players.PlayerAdded:connect(function()
  101. adjust(nil)
  102. end)
  103.  
  104. players.PlayerRemoving:connect(function(leaving)
  105. adjust(leaving.Name)
  106. end)
  107.  
  108. adjust()
  109.  
  110. --PlayerCommands
  111.  
  112.  
  113. --Selection
  114.  
  115. gui.UI.Selection.Players.MouseButton1Click:connect(function()
  116. gui.UI.Selection["Bar"]:TweenPosition(UDim2.new(0.024,0,0.838,0),"Out","Sine",.5,true)
  117. wait(.05)
  118. gui.UI.Players.Visible = true
  119. gui.UI["Devil Fruits"].Visible = false
  120. end)
  121.  
  122. gui.UI.Selection["Devil Fruits"].MouseButton1Click:connect(function()
  123. gui.UI.Selection["Bar"]:TweenPosition(UDim2.new(0.351,0,0.838,0),"Out","Sine",.5,true)
  124. wait(.05)
  125. gui.UI.Players.Visible = false
  126. gui.UI["Devil Fruits"].Visible = true
  127. end)
  128.  
  129. gui.UI.Selection.Misc.MouseButton1Click:connect(function()
  130. gui.UI.Selection["Bar"]:TweenPosition(UDim2.new(0.679,0,0.838,0),"Out","Sine",.5,true)
  131. end)
  132.  
  133. --Open and close
  134.  
  135. gui.UI.Topbar.Close.MouseButton1Click:connect(function()
  136. gui.UI.Visible = false
  137. gui.Open.Visible = true
  138. end)
  139.  
  140. gui.Open.oof.MouseButton1Click:connect(function()
  141. gui.UI.Visible = true
  142. gui.Open.Visible = false
  143. end)
  144.  
  145. --Devil Fruit Spawner Buttons
  146.  
  147. gui.UI["Devil Fruits"].ScrollingFrame.Bison.MouseButton1Click:connect(function()
  148. game.Players.InventoryGui.Inventory.InventorySlot1.Value = "#36700101"
  149. end)
  150.  
  151. gui.UI["Devil Fruits"].ScrollingFrame.Chop.MouseButton1Click:connect(function()
  152. game.Players.InventoryGui.Inventory.InventorySlot1.Value = "#18800166"
  153. end)
  154.  
  155. gui.UI["Devil Fruits"].ScrollingFrame.Dice.MouseButton1Click:connect(function()
  156. game.Players.InventoryGui.Inventory.InventorySlot1.Value = "#18834315"
  157. end)
  158.  
  159. gui.UI["Devil Fruits"].ScrollingFrame.Kilo.MouseButton1Click:connect(function()
  160. game.Players.InventoryGui.Inventory.InventorySlot1.Value = "#18800132"
  161. end)
  162.  
  163. gui.UI["Devil Fruits"].ScrollingFrame.Mera.MouseButton1Click:connect(function()
  164. game.Players.InventoryGui.Inventory.InventorySlot1.Value = "#79900344"
  165. end)
  166.  
  167. gui.UI["Devil Fruits"].ScrollingFrame.Moku.MouseButton1Click:connect(function()
  168. game.Players.InventoryGui.Inventory.InventorySlot1.Value = "#79900228"
  169. end)
  170.  
  171. gui.UI["Devil Fruits"].ScrollingFrame.Pika.MouseButton1Click:connect(function()
  172. game.Players.InventoryGui.Inventory.InventorySlot1.Value = "#79900312"
  173. end)
  174.  
  175. gui.UI["Devil Fruits"].ScrollingFrame.Suna.MouseButton1Click:connect(function()
  176. game.Players.InventoryGui.Inventory.InventorySlot1.Value = "#79900156"
  177. end)
  178.  
  179. gui.UI["Devil Fruits"].ScrollingFrame.Toge.MouseButton1Click:connect(function()
  180. game.Players.InventoryGui.Inventory.InventorySlot1.Value = "#18800188"
  181. end)
  182.  
  183. gui.UI["Devil Fruits"].ScrollingFrame.Toru.MouseButton1Click:connect(function()
  184. game.Players.InventoryGui.Inventory.InventorySlot1.Value = "#36700110"
  185. end)
  186.  
  187. gui.UI["Devil Fruits"].ScrollingFrame.Wax.MouseButton1Click:connect(function()
  188. game.Players.InventoryGui.Inventory.InventorySlot1.Value = "#18800101"
  189. end)
  190.  
  191. gui.UI["Devil Fruits"].ScrollingFrame.Yami.MouseButton1Click:connect(function()
  192. game.Players.InventoryGui.Inventory.InventorySlot1.Value = "#79900447"
  193. end)
Advertisement
Add Comment
Please, Sign In to add comment