Advertisement
JJBloxxer

Custom Player List GUI by JJBIoxxer

Oct 15th, 2019
3,678
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1. local plrList = script.Parent.List
  2. local sample = script.Sample
  3. local button = script.Parent.Parent["Open/Close"]
  4. local open = script.Parent.Open.Value
  5.  
  6. button.MouseButton1Click:Connect(function()
  7.     if not open then
  8.         script.Parent:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Bounce", 0.6, true)
  9.         wait(0.6)
  10.         open = true
  11.     else
  12.         script.Parent:TweenPosition(UDim2.new(-1, 0, 0.5, 0), "Out", "Bounce", 0.6, true)
  13.         wait(0.6)
  14.         open = false
  15.     end
  16. end)
  17.  
  18. function clearList()
  19.     for _, item in pairs(plrList:GetChildren()) do
  20.         if item:IsA("TextLabel") then
  21.             item:Destroy()
  22.         end
  23.     end
  24. end
  25.  
  26. function fillList()
  27.     clearList()
  28.     for _, player in pairs(game.Players:GetChildren()) do
  29.         if not plrList:FindFirstChild(player.Name) then
  30.             local new = sample:Clone()
  31.             new.Name = player.Name
  32.             new.Text = player.Name
  33.             new.Parent = plrList
  34.         end
  35.     end
  36.     plrList.CanvasSize = UDim2.new(0, 0, 0, plrList.UI.AbsoluteContentSize.Y)
  37. end
  38.  
  39. fillList()
  40.  
  41. game.Players.PlayerAdded:Connect(fillList)
  42. game.Players.PlayerRemoving:Connect(fillList)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement