Advertisement
crunchbone

GrpViewerSrc

Feb 5th, 2021
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.82 KB | None | 0 0
  1. local GuiObj = script.Parent
  2. local Frame = GuiObj.Mainframe
  3. local tabName = Frame.tabName
  4. local exitButt = Frame.exitButton
  5. local scroll = Frame.scrollFrame
  6. local userText = Frame.userText
  7. local searchButton = Frame.searchButton
  8. local openButton = GuiObj.Fakeframe.openButton
  9. local fakeFrame = GuiObj.Fakeframe
  10.  
  11. local display = Instance.new("TextLabel")
  12. display.Size = UDim2.new(1, 0, 0, 50)
  13. display.BackgroundColor3 = Color3.new(0,0,0)
  14. display.BackgroundTransparency = 0.9
  15. display.TextColor3 = Color3.new(255,255,255)
  16. display.TextTruncate = Enum.TextTruncate.AtEnd
  17.  
  18. local imag = Instance.new("ImageLabel")
  19. imag.BackgroundTransparency = 1
  20. imag.Size = UDim2.new(0,50,0,50)
  21.  
  22. local GroupService = game:GetService("GroupService")
  23.  
  24.  
  25.  
  26. local function search()
  27.     local init = 0
  28.     scroll:ClearAllChildren()
  29.     local t = Instance.new("UIListLayout")
  30.     t.SortOrder = Enum.SortOrder.Name
  31.     t.Parent = scroll
  32.     local int
  33.     local succ, err = pcall(function()
  34.         int = game.Players:GetUserIdFromNameAsync(userText.Text)
  35.     end)
  36.     if err then
  37.         int = 0
  38.     end
  39.     local groups = GroupService:GetGroupsAsync(int)
  40.     for _, groupInfo in pairs(groups) do
  41.         local disp = display:Clone()
  42.         local cord = imag:Clone()
  43.         disp.Parent = scroll
  44.         cord.Parent = disp
  45.         disp.Name = groupInfo['Name']
  46.         disp.Text = "Name: "..groupInfo['Name'].."   Rank: "..groupInfo["Role"].."\t   Id:"..groupInfo["Rank"]
  47.         cord.Image = groupInfo["EmblemUrl"]
  48.         init+=1
  49.     end
  50.     scroll.CanvasSize = UDim2.fromOffset(0,init*50)
  51. end
  52.  
  53. searchButton.MouseButton1Down:Connect(search)
  54.  
  55. userText.focusLost:Connect(function(enter,inp)
  56.     if enter then
  57.         search()
  58.     end
  59. end)
  60.  
  61. exitButt.MouseButton1Down:Connect(function()
  62.     fakeFrame.Visible = true
  63.     Frame.Visible = false
  64. end)
  65.  
  66. openButton.MouseButton1Down:Connect(function()
  67.     fakeFrame.Visible = false
  68.     Frame.Visible = true
  69. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement