Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local GuiObj = script.Parent
- local Frame = GuiObj.Mainframe
- local tabName = Frame.tabName
- local exitButt = Frame.exitButton
- local scroll = Frame.scrollFrame
- local userText = Frame.userText
- local searchButton = Frame.searchButton
- local openButton = GuiObj.Fakeframe.openButton
- local fakeFrame = GuiObj.Fakeframe
- local display = Instance.new("TextLabel")
- display.Size = UDim2.new(1, 0, 0, 50)
- display.BackgroundColor3 = Color3.new(0,0,0)
- display.BackgroundTransparency = 0.9
- display.TextColor3 = Color3.new(255,255,255)
- display.TextTruncate = Enum.TextTruncate.AtEnd
- local imag = Instance.new("ImageLabel")
- imag.BackgroundTransparency = 1
- imag.Size = UDim2.new(0,50,0,50)
- local GroupService = game:GetService("GroupService")
- local function search()
- local init = 0
- scroll:ClearAllChildren()
- local t = Instance.new("UIListLayout")
- t.SortOrder = Enum.SortOrder.Name
- t.Parent = scroll
- local int
- local succ, err = pcall(function()
- int = game.Players:GetUserIdFromNameAsync(userText.Text)
- end)
- if err then
- int = 0
- end
- local groups = GroupService:GetGroupsAsync(int)
- for _, groupInfo in pairs(groups) do
- local disp = display:Clone()
- local cord = imag:Clone()
- disp.Parent = scroll
- cord.Parent = disp
- disp.Name = groupInfo['Name']
- disp.Text = "Name: "..groupInfo['Name'].." Rank: "..groupInfo["Role"].."\t Id:"..groupInfo["Rank"]
- cord.Image = groupInfo["EmblemUrl"]
- init+=1
- end
- scroll.CanvasSize = UDim2.fromOffset(0,init*50)
- end
- searchButton.MouseButton1Down:Connect(search)
- userText.focusLost:Connect(function(enter,inp)
- if enter then
- search()
- end
- end)
- exitButt.MouseButton1Down:Connect(function()
- fakeFrame.Visible = true
- Frame.Visible = false
- end)
- openButton.MouseButton1Down:Connect(function()
- fakeFrame.Visible = false
- Frame.Visible = true
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement