Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- ▒█▀▀▀█ ▀▀█▀▀ ▒█▀▀▀ ▒█▀▀▄ ░█▀▀█ ░█▀▀█
- ░▀▀▀▄▄ ░▒█░░ ▒█▀▀▀ ▒█░▒█ ▒█▄▄█ ▒█▄▄█
- ▒█▄▄▄█ ░▒█░░ ▒█▄▄▄ ▒█▄▄▀ ▒█░▒█ ▒█░▒█
- ===========================================================================
- Author : Stedaa, Refrence from 'Brawl Stars' by supercell
- Description : Script responsible for the function of the player list
- Last edited on : 18 July 2018
- Copyright
- ---------------------------------------------------------------------------
- (c) Copyright 2018 Stedaa Games
- License
- ---------------------------------------------------------------------------
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- ]]
- game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
- local item = game:GetService("ReplicatedStorage"):WaitForChild("PlayerLabelTemplate")
- local holder = script.Parent.Main.PlayerList:WaitForChild("Holder")
- local BG = script.Parent.Main.PlayerList:WaitForChild("Background")
- local function add(player)
- local new = item:Clone()
- new.Name = player.Name
- new.PlayerName.Text = player.Name
- new.PlayerName.Shadow.Text = player.Name
- new.Position = UDim2.new(1,0,0 + (0.08 * #holder:GetChildren()), 0)
- new.Parent = holder
- if #holder:GetChildren() == 1 then
- BG.Size = UDim2.new(1,0,0.09,0)
- elseif #holder:GetChildren() == 2 then
- BG.Size = UDim2.new(1,0,0.17,0)
- elseif #holder:GetChildren() == 3 then
- BG.Size = UDim2.new(1,0,0.25,0)
- elseif #holder:GetChildren() == 4 then
- BG.Size = UDim2.new(1,0,0.34,0)
- elseif #holder:GetChildren() == 5 then
- BG.Size = UDim2.new(1,0,0.42,0)
- elseif #holder:GetChildren() == 6 then
- BG.Size = UDim2.new(0,0,0.5,0)
- elseif #holder:GetChildren() == 7 then
- BG.Size = UDim2.new(0,0,0.58,0)
- elseif #holder:GetChildren() == 8 then
- BG.Size = UDim2.new(0,0,0.67,0)
- elseif #holder:GetChildren() == 9 then
- BG.Size = UDim2.new(0,0,0.75,0)
- elseif #holder:GetChildren() == 10 then
- BG.Size = UDim2.new(0,0,0.83,0)
- elseif #holder:GetChildren() == 11 then
- BG.Size = UDim2.new(0,0,0.92,0)
- elseif #holder:GetChildren() == 12 then
- BG.Size = UDim2.new(0,0,1,0)
- end
- local RepStorage = game:GetService("ReplicatedStorage")
- local Event = RepStorage:WaitForChild("Leaderboard")
- Event.OnClientEvent:connect(function(PlayerName,c00lkidd)
- item.LevelIndicator.Level.Text = c00lkidd
- end)
- end
- for i,v in pairs(game.Players:GetPlayers())do
- add(v)
- end
- game.Players.PlayerAdded:connect(function(player)
- add(player)
- end)
- game.Players.PlayerRemoving:connect(function(player)
- local find = holder:FindFirstChild(player.Name)
- if find then
- find:Destroy() --Add tweening here
- if #holder:GetChildren() == 1 then
- BG.Size = UDim2.new(1,0,0.09,0)
- elseif #holder:GetChildren() == 2 then
- BG.Size = UDim2.new(1,0,0.17,0)
- elseif #holder:GetChildren() == 3 then
- BG.Size = UDim2.new(1,0,0.25,0)
- elseif #holder:GetChildren() == 4 then
- BG.Size = UDim2.new(1,0,0.34,0)
- elseif #holder:GetChildren() == 5 then
- BG.Size = UDim2.new(1,0,0.42,0)
- elseif #holder:GetChildren() == 6 then
- BG.Size = UDim2.new(0,0,0.5,0)
- elseif #holder:GetChildren() == 7 then
- BG.Size = UDim2.new(0,0,0.58,0)
- elseif #holder:GetChildren() == 8 then
- BG.Size = UDim2.new(0,0,0.67,0)
- elseif #holder:GetChildren() == 9 then
- BG.Size = UDim2.new(0,0,0.75,0)
- elseif #holder:GetChildren() == 10 then
- BG.Size = UDim2.new(0,0,0.83,0)
- elseif #holder:GetChildren() == 11 then
- BG.Size = UDim2.new(0,0,0.92,0)
- elseif #holder:GetChildren() == 12 then
- BG.Size = UDim2.new(0,0,1,0)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement