Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plrList = script.Parent.List
- local sample = script.Sample
- local button = script.Parent.Parent["Open/Close"]
- local open = script.Parent.Open.Value
- button.MouseButton1Click:Connect(function()
- if not open then
- script.Parent:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Bounce", 0.6, true)
- wait(0.6)
- open = true
- else
- script.Parent:TweenPosition(UDim2.new(-1, 0, 0.5, 0), "Out", "Bounce", 0.6, true)
- wait(0.6)
- open = false
- end
- end)
- function clearList()
- for _, item in pairs(plrList:GetChildren()) do
- if item:IsA("TextLabel") then
- item:Destroy()
- end
- end
- end
- function fillList()
- clearList()
- for _, player in pairs(game.Players:GetChildren()) do
- if not plrList:FindFirstChild(player.Name) then
- local new = sample:Clone()
- new.Name = player.Name
- new.Text = player.Name
- new.Parent = plrList
- end
- end
- plrList.CanvasSize = UDim2.new(0, 0, 0, plrList.UI.AbsoluteContentSize.Y)
- end
- fillList()
- game.Players.PlayerAdded:Connect(fillList)
- game.Players.PlayerRemoving:Connect(fillList)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement