Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game.Players.GmodMoney
- game:GetService('StarterGui'):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
- game:GetService('StarterGui'):SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
- local busy = script:WaitForChild('InUse')
- local LBGui = script.Parent:WaitForChild('LeaderboardGui')
- local DB = script.Parent:WaitForChild('DatabaseGui')
- local Buttons = DB:WaitForChild('ArrestNum')
- local Next = Buttons:WaitForChild('Next')
- local Prev = Buttons:WaitForChild('Previous')
- local events = game:GetService('ReplicatedStorage'):WaitForChild('Events')
- local group = 2810705
- local adminrank = 250
- local index = 1
- --print(index)
- local user = nil
- local currentButtons = {}
- function getinfo(arrests,type)
- if #arrests ~= 0 then
- if index == #arrests and type == 'Add' then
- index=1
- -- print(index)
- elseif index == 1 and type == 'Subtract' then
- index=#arrests
- -- print(index)
- else
- if type == 'Add' then
- index = index + 1
- -- print(index)
- elseif type == 'Subtract' then
- index = index - 1
- -- print(index)
- elseif type == 'Hold' then
- index = 1
- -- print(index)
- end
- end
- DB.ArrestNum.Text = 'ARREST # ' .. index .. '/'..#arrests
- DB.Arrester.Text = 'Arrester: '..game.Players:GetNameFromUserIdAsync(arrests[index][2])
- DB.Reason.Text = 'Reason(s): '..arrests[index][3]
- DB.Notes.Text = 'Notes: '..arrests[index][4]
- DB.Date.Text = 'Date: '..arrests[index][5]
- else
- DB.ArrestNum.Text = 'ARREST # 1/1'
- DB.Arrester.Text = 'Arrester: N/A'
- DB.Reason.Text = 'Reason(s): N/A'
- DB.Notes.Text = 'Notes: N/A'
- DB.Date.Text = 'Date: N/A'
- end
- end
- function checkfriends(bc,vic,gui)
- if vic:IsFriendsWith(plr.UserId) and vic ~= plr and bc then
- gui.Frame.isFriend.Visible = true
- elseif not vic:IsFriendsWith(plr.UserId) and vic ~= plr and bc then
- gui.Frame.Username.Position = UDim2.new(0,20,0,0)
- gui.Frame.Username.Size = UDim2.new(1,-20,1,0)
- gui.Frame.isFriend:Destroy()
- elseif vic:IsFriendsWith(plr.UserId) and vic ~= plr and not bc then
- gui.Frame.isFriend:Destroy()
- gui.Frame.isBC.Name = 'isFriend'
- gui.Frame.isFriend.Image = 'rbxasset://textures/ui/icon_friends_16.png'
- gui.Frame.isFriend.Visible = true
- gui.Frame.Username.Position = UDim2.new(0,20,0,0)
- gui.Frame.Username.Size = UDim2.new(1,-20,1,0)
- elseif not vic:IsFriendsWith(plr.UserId) and vic ~= plr and not bc then
- gui.Frame.isBC:Destroy()
- gui.Frame.isFriend:Destroy()
- gui.Frame.Username.Position = UDim2.new(0,0,0,0)
- gui.Frame.Username.Size = UDim2.new(1,0,1,0)
- elseif vic == plr and bc then
- gui.Frame.Username.Position = UDim2.new(0,20,0,0)
- gui.Frame.Username.Size = UDim2.new(1,-20,1,0)
- gui.Frame.isFriend:Destroy()
- elseif vic == plr and not bc then
- gui.Frame.isBC:Destroy()
- gui.Frame.isFriend:Destroy()
- gui.Frame.Username.Position = UDim2.new(0,0,0,0)
- gui.Frame.Username.Size = UDim2.new(1,0,1,0)
- end
- end
- function creategui(vic)
- local gui = script.Example:Clone()
- local membershipType = vic.MembershipType
- if vic:IsInGroup(group) and vic:GetRankInGroup(group) >= adminrank then
- gui.Frame.isBC.Visible = true
- gui.Frame.isBC.Image = 'http://www.roblox.com/asset/?id=132769868'
- checkfriends(true,vic,gui)
- elseif membershipType == Enum.MembershipType.BuildersClub then
- gui.Frame.isBC.Visible = true
- gui.Frame.isBC.Image = 'rbxasset://textures/ui/icon_BC-16.png'
- checkfriends(true,vic,gui)
- elseif membershipType == Enum.MembershipType.TurboBuildersClub then
- gui.Frame.isBC.Visible = true
- gui.Frame.isBC.Image = 'rbxasset://textures/ui/icon_TBC-16.png'
- checkfriends(true,vic,gui)
- elseif membershipType == Enum.MembershipType.OutrageousBuildersClub then
- gui.Frame.isBC.Visible = true
- gui.Frame.isBC.Image = 'rbxasset://textures/ui/icon_OBC-16.png'
- checkfriends(true,vic,gui)
- elseif membershipType == Enum.MembershipType.None then
- checkfriends(false,vic,gui)
- end
- gui.Name = vic.Name
- gui.Frame.Username.Text = vic.Name
- gui.Parent = LBGui
- gui.Frame.Visible = true
- gui.Frame:TweenPosition(UDim2.new(1,-204,0, -34 +(#LBGui:GetChildren() * 28)), "Out", "Sine", 0.2, true)
- table.insert(currentButtons,gui)
- end
- function deletebuttons(vic)
- for i,v in pairs(LBGui:GetChildren()) do
- if v.Name~=vic.Name then
- print'test'
- --print(v)
- --print(vic)
- v:Destroy()
- end
- end
- print'nope'
- --print(vic)
- currentButtons={vic}
- end
- function checkClick()
- for _,gui in pairs(currentButtons)do
- gui.MouseButton1Down:connect(function(m)
- user = game.Players:FindFirstChild(gui.Frame.Username.Text) and game.Players[gui.Frame.Username.Text].Name
- --print(user)
- --print(#currentButtons)
- index = 1
- if busy.Value == false then
- busy.Value = true
- DB.Username.Text = user:upper()..'\'S ARREST DATA'
- DB.Character.Image = 'http://www.roblox.com/Thumbs/Avatar.ashx?x=200&y=200&Format=Png&username='..user
- LBGui:FindFirstChild(user):TweenPosition(UDim2.new(1, -204,0, 6), "Out", "Sine", 0.2, true)
- deletebuttons(LBGui:FindFirstChild(user))
- local arrests = events.RequestArrests:InvokeServer(game.Players:FindFirstChild(user))
- getinfo(arrests, 'Hold')
- DB:TweenPosition(UDim2.new(1,-302,0, 32), "Out", "Sine", 0.2, true)
- Next.MouseButton1Down:connect(function(m)
- getinfo(arrests,'Add')
- end)
- Prev.MouseButton1Down:connect(function(m)
- getinfo(arrests,'Subtract')
- end)
- elseif busy.Value == true then
- DB:TweenPosition(UDim2.new(1,100,0, 32), "Out", "Sine", 0.2, true)
- wait(0.2)
- LBGui:FindFirstChild(user):Destroy()
- currentButtons={};
- creategui(plr)
- for i,v in pairs(game.Players:GetPlayers()) do
- if v ~= plr then
- creategui(v)
- end
- end
- checkClick()
- user = nil
- busy.Value = false
- end
- end)
- end
- end
- wait(1)
- creategui(plr)
- wait(1)
- for i,v in pairs(game.Players:GetPlayers()) do
- if v ~= plr and busy.Value ~= true then
- creategui(v)
- end
- end
- checkClick()
- game.Players.PlayerAdded:connect(function(new)
- if not LBGui:FindFirstChild(new) and busy.Value ~= true then
- creategui(new)
- end
- end)
- game.Players.PlayerRemoving:connect(function(left)
- if busy.Value ~= true then
- LBGui:FindFirstChild(left.Name):Destroy()
- for i,v in pairs(LBGui:GetChildren()) do
- if v:IsA('Frame') and v.Name ~= plr.Name then
- v:Destroy()
- end
- end
- for i,v in pairs(game.Players:GetPlayers()) do
- if v ~= plr then
- creategui(v)
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement