SebTDZ

SB Ranks

Jul 9th, 2019
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.43 KB | None | 0 0
  1. Player = owner.Name
  2.  
  3. local ScreenGui = Instance.new("ScreenGui",game:GetService("Players")[Player].PlayerGui)
  4. ScreenGui.Name = "SB-Ranks"
  5.  
  6. local Frame = Instance.new("Frame",ScreenGui)
  7. Frame.Position = UDim2.new(1 - 0.3,0,0,0)
  8. Frame.Size = UDim2.new(0.3,0,1,0)
  9. Frame.BackgroundColor3 = Color3.new(0.5,0.5,0.5)
  10.  
  11. local ScrollingFrame = Instance.new("Frame",Frame)
  12. ScrollingFrame.Position = UDim2.new(0,0,0.1,0)
  13. ScrollingFrame.Size = UDim2.new(0.9,0,0.9,0)
  14. ScrollingFrame.BackgroundColor3 = Color3.new(1,1,1)
  15.  
  16. local ScrollBarFrame = Instance.new("Frame",Frame)
  17. ScrollBarFrame.Position = UDim2.new(0.9,0,0.1,0)
  18. ScrollBarFrame.Size = UDim2.new(0.1,0,0.9,0)
  19. ScrollBarFrame.BackgroundColor3 = Color3.new(0.9,0.9,0.9)
  20.  
  21. local DownButton = Instance.new("TextButton",ScrollBarFrame)
  22. DownButton.Text = "V"
  23. DownButton.Position = UDim2.new(0,0,0.5,0)
  24. DownButton.Size = UDim2.new(1,0,0.5,0)
  25. DownButton.BackgroundColor3 = Color3.new(0.9,0.9,0.9)
  26. DownButton.MouseButton1Click:Connect(function()
  27.     for i,tb in pairs(ScrollingFrame:GetChildren()) do
  28.         tb.Position = tb.Position - UDim2.new(0,0,0.05,0)
  29.     end
  30. end)
  31.  
  32. local UpButton = Instance.new("TextButton",ScrollBarFrame)
  33. UpButton.Text = "V"
  34. UpButton.Position = UDim2.new(0,0,0,0)
  35. UpButton.Size = UDim2.new(1,0,0.5,0)
  36. UpButton.Rotation = 180
  37. UpButton.BackgroundColor3 = Color3.new(0.9,0.9,0.9)
  38. UpButton.MouseButton1Click:Connect(function()
  39.     for i,tb in pairs(ScrollingFrame:GetChildren()) do
  40.         tb.Position = tb.Position + UDim2.new(0,0,0.05,0)
  41.     end
  42. end)
  43.  
  44. added = 0
  45. function Add(plr)  
  46.     local TextLabel = Instance.new("TextLabel",ScrollingFrame)
  47.     TextLabel.Text = plr.Name
  48.     TextLabel.Position = UDim2.new(0.3,0,added,0)
  49.     TextLabel.Size = UDim2.new(1-0.3,0,0.05,0)
  50.     TextLabel.BackgroundColor3 = Color3.new(0.9,0.9,0.9)
  51.  
  52.     local TextLabel2 = Instance.new("TextLabel",ScrollingFrame)
  53.     TextLabel2.Text = plr:GetRoleInGroup(3256759)
  54.     TextLabel2.Position = UDim2.new(0,0,added,0)
  55.     TextLabel2.Size = UDim2.new(0.3,0,0.05,0)
  56.     TextLabel2.BackgroundColor3 = Color3.new(0.9,0.9,0.9)
  57.  
  58.     added = added + 0.05
  59. end
  60. function Open()
  61.     added = 0
  62.     for i,v in pairs(ScrollingFrame:GetChildren()) do
  63.         v:Remove()
  64.     end
  65.     for i,v in pairs(game.Players:GetChildren()) do
  66.         Add(v)
  67.     end
  68.     game.Players.ChildAdded:connect(function(v)
  69.         Add(v)
  70.     end)
  71. end
  72.  
  73. local TextLabel = Instance.new("TextLabel",Frame)
  74. TextLabel.Text = "SB Ranks"
  75. TextLabel.Size = UDim2.new(1,0,0.1,0)
  76. TextLabel.BackgroundColor3 = Color3.new(0.5,0.5,0.5)
  77. TextLabel.TextScaled = true
  78.  
  79. local Frame2 = Instance.new("Frame",ScreenGui)
  80. Frame2.Position = UDim2.new(1-0.3,0,-0.05,0)
  81. Frame2.Size = UDim2.new(0.3,0,0.05,0)
  82. Frame2.BackgroundColor3 = Color3.new(0,0,0)
  83.  
  84. local COButton = Instance.new("TextButton",ScreenGui)
  85. COButton.Text = "V"
  86. COButton.Rotation = 90 * 3
  87. COButton.Position = UDim2.new(1 - 0.425,0,1-0.225,0)
  88. COButton.Size = UDim2.new(0.2,0,0.1,0)
  89. COButton.BackgroundColor3 = Color3.new(1,1,1)
  90. COButton.MouseButton1Click:Connect(function()
  91.     if COButton.Rotation == 90 * 3 then
  92.         COButton.Rotation = 90
  93.         Frame.Position = UDim2.new(1,0,0,0)
  94.         COButton.Position = UDim2.new(1 - 0.125,0,1-0.225,0)
  95.     else
  96.         COButton.Rotation = 90 * 3
  97.         Frame.Position = UDim2.new(1 - 0.3,0,0,0)
  98.         COButton.Position = UDim2.new(1 - 0.425,0,1-0.225,0)
  99.     end
  100. end)
  101.  
  102. Open()
  103. game.Players.RemovingPlayer:Connect(function()
  104.     Open()
  105. end)
Advertisement
Add Comment
Please, Sign In to add comment