Advertisement
Gmodmoney2

Untitled

Jun 19th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.39 KB | None | 0 0
  1. local plr = game.Players.GmodMoney
  2. game:GetService('StarterGui'):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
  3. game:GetService('StarterGui'):SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
  4. local busy = script:WaitForChild('InUse')
  5. local LBGui = script.Parent:WaitForChild('LeaderboardGui')
  6. local DB = script.Parent:WaitForChild('DatabaseGui')
  7. local Buttons = DB:WaitForChild('ArrestNum')
  8. local Next = Buttons:WaitForChild('Next')
  9. local Prev = Buttons:WaitForChild('Previous')
  10. local events = game:GetService('ReplicatedStorage'):WaitForChild('Events')
  11. local group = 2810705
  12. local adminrank = 250
  13. local index = 1
  14. --print(index)
  15. local user = nil
  16. local currentButtons = {}
  17.  
  18. function getinfo(arrests,type)
  19. if #arrests ~= 0 then
  20. if index == #arrests and type == 'Add' then
  21. index=1
  22. -- print(index)
  23. elseif index == 1 and type == 'Subtract' then
  24. index=#arrests
  25. -- print(index)
  26. else
  27. if type == 'Add' then
  28. index = index + 1
  29. -- print(index)
  30. elseif type == 'Subtract' then
  31. index = index - 1
  32. -- print(index)
  33. elseif type == 'Hold' then
  34. index = 1
  35. -- print(index)
  36. end
  37. end
  38. DB.ArrestNum.Text = 'ARREST # ' .. index .. '/'..#arrests
  39. DB.Arrester.Text = 'Arrester: '..game.Players:GetNameFromUserIdAsync(arrests[index][2])
  40. DB.Reason.Text = 'Reason(s): '..arrests[index][3]
  41. DB.Notes.Text = 'Notes: '..arrests[index][4]
  42. DB.Date.Text = 'Date: '..arrests[index][5]
  43. else
  44. DB.ArrestNum.Text = 'ARREST # 1/1'
  45. DB.Arrester.Text = 'Arrester: N/A'
  46. DB.Reason.Text = 'Reason(s): N/A'
  47. DB.Notes.Text = 'Notes: N/A'
  48. DB.Date.Text = 'Date: N/A'
  49. end
  50. end
  51.  
  52. function checkfriends(bc,vic,gui)
  53. if vic:IsFriendsWith(plr.UserId) and vic ~= plr and bc then
  54. gui.Frame.isFriend.Visible = true
  55. elseif not vic:IsFriendsWith(plr.UserId) and vic ~= plr and bc then
  56. gui.Frame.Username.Position = UDim2.new(0,20,0,0)
  57. gui.Frame.Username.Size = UDim2.new(1,-20,1,0)
  58. gui.Frame.isFriend:Destroy()
  59. elseif vic:IsFriendsWith(plr.UserId) and vic ~= plr and not bc then
  60. gui.Frame.isFriend:Destroy()
  61. gui.Frame.isBC.Name = 'isFriend'
  62. gui.Frame.isFriend.Image = 'rbxasset://textures/ui/icon_friends_16.png'
  63. gui.Frame.isFriend.Visible = true
  64. gui.Frame.Username.Position = UDim2.new(0,20,0,0)
  65. gui.Frame.Username.Size = UDim2.new(1,-20,1,0)
  66. elseif not vic:IsFriendsWith(plr.UserId) and vic ~= plr and not bc then
  67. gui.Frame.isBC:Destroy()
  68. gui.Frame.isFriend:Destroy()
  69. gui.Frame.Username.Position = UDim2.new(0,0,0,0)
  70. gui.Frame.Username.Size = UDim2.new(1,0,1,0)
  71. elseif vic == plr and bc then
  72. gui.Frame.Username.Position = UDim2.new(0,20,0,0)
  73. gui.Frame.Username.Size = UDim2.new(1,-20,1,0)
  74. gui.Frame.isFriend:Destroy()
  75. elseif vic == plr and not bc then
  76. gui.Frame.isBC:Destroy()
  77. gui.Frame.isFriend:Destroy()
  78. gui.Frame.Username.Position = UDim2.new(0,0,0,0)
  79. gui.Frame.Username.Size = UDim2.new(1,0,1,0)
  80. end
  81. end
  82.  
  83. function creategui(vic)
  84. local gui = script.Example:Clone()
  85. local membershipType = vic.MembershipType
  86. if vic:IsInGroup(group) and vic:GetRankInGroup(group) >= adminrank then
  87. gui.Frame.isBC.Visible = true
  88. gui.Frame.isBC.Image = 'http://www.roblox.com/asset/?id=132769868'
  89. checkfriends(true,vic,gui)
  90. elseif membershipType == Enum.MembershipType.BuildersClub then
  91. gui.Frame.isBC.Visible = true
  92. gui.Frame.isBC.Image = 'rbxasset://textures/ui/icon_BC-16.png'
  93. checkfriends(true,vic,gui)
  94. elseif membershipType == Enum.MembershipType.TurboBuildersClub then
  95. gui.Frame.isBC.Visible = true
  96. gui.Frame.isBC.Image = 'rbxasset://textures/ui/icon_TBC-16.png'
  97. checkfriends(true,vic,gui)
  98. elseif membershipType == Enum.MembershipType.OutrageousBuildersClub then
  99. gui.Frame.isBC.Visible = true
  100. gui.Frame.isBC.Image = 'rbxasset://textures/ui/icon_OBC-16.png'
  101. checkfriends(true,vic,gui)
  102. elseif membershipType == Enum.MembershipType.None then
  103. checkfriends(false,vic,gui)
  104. end
  105. gui.Name = vic.Name
  106. gui.Frame.Username.Text = vic.Name
  107. gui.Parent = LBGui
  108. gui.Frame.Visible = true
  109. gui.Frame:TweenPosition(UDim2.new(1,-204,0, -34 +(#LBGui:GetChildren() * 28)), "Out", "Sine", 0.2, true)
  110. table.insert(currentButtons,gui)
  111. end
  112.  
  113. function deletebuttons(vic)
  114. for i,v in pairs(LBGui:GetChildren()) do
  115. if v.Name~=vic.Name then
  116. print'test'
  117. --print(v)
  118. --print(vic)
  119. v:Destroy()
  120. end
  121. end
  122. print'nope'
  123. --print(vic)
  124. currentButtons={vic}
  125. end
  126.  
  127. function checkClick()
  128. for _,gui in pairs(currentButtons)do
  129. gui.MouseButton1Down:connect(function(m)
  130. user = game.Players:FindFirstChild(gui.Frame.Username.Text) and game.Players[gui.Frame.Username.Text].Name
  131. --print(user)
  132. --print(#currentButtons)
  133. index = 1
  134. if busy.Value == false then
  135. busy.Value = true
  136. DB.Username.Text = user:upper()..'\'S ARREST DATA'
  137. DB.Character.Image = 'http://www.roblox.com/Thumbs/Avatar.ashx?x=200&y=200&Format=Png&username='..user
  138. LBGui:FindFirstChild(user):TweenPosition(UDim2.new(1, -204,0, 6), "Out", "Sine", 0.2, true)
  139. deletebuttons(LBGui:FindFirstChild(user))
  140. local arrests = events.RequestArrests:InvokeServer(game.Players:FindFirstChild(user))
  141. getinfo(arrests, 'Hold')
  142. DB:TweenPosition(UDim2.new(1,-302,0, 32), "Out", "Sine", 0.2, true)
  143. Next.MouseButton1Down:connect(function(m)
  144. getinfo(arrests,'Add')
  145. end)
  146. Prev.MouseButton1Down:connect(function(m)
  147. getinfo(arrests,'Subtract')
  148. end)
  149. elseif busy.Value == true then
  150. DB:TweenPosition(UDim2.new(1,100,0, 32), "Out", "Sine", 0.2, true)
  151. wait(0.2)
  152. LBGui:FindFirstChild(user):Destroy()
  153. currentButtons={};
  154. creategui(plr)
  155. for i,v in pairs(game.Players:GetPlayers()) do
  156. if v ~= plr then
  157. creategui(v)
  158. end
  159. end
  160. checkClick()
  161. user = nil
  162. busy.Value = false
  163. end
  164. end)
  165. end
  166. end
  167. wait(1)
  168. creategui(plr)
  169. wait(1)
  170. for i,v in pairs(game.Players:GetPlayers()) do
  171. if v ~= plr and busy.Value ~= true then
  172. creategui(v)
  173. end
  174. end
  175. checkClick()
  176.  
  177. game.Players.PlayerAdded:connect(function(new)
  178. if not LBGui:FindFirstChild(new) and busy.Value ~= true then
  179. creategui(new)
  180. end
  181. end)
  182.  
  183. game.Players.PlayerRemoving:connect(function(left)
  184. if busy.Value ~= true then
  185. LBGui:FindFirstChild(left.Name):Destroy()
  186. for i,v in pairs(LBGui:GetChildren()) do
  187. if v:IsA('Frame') and v.Name ~= plr.Name then
  188. v:Destroy()
  189. end
  190. end
  191. for i,v in pairs(game.Players:GetPlayers()) do
  192. if v ~= plr then
  193. creategui(v)
  194. end
  195. end
  196. end
  197. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement