Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Teams = game:GetService("Teams")
- local Player = game.Players.LocalPlayer
- if not Player:FindFirstChild("leaderstats") then
- local leader = Instance.new("Folder",Player)
- leader.Name = "leaderstats"
- local bounti = Instance.new("NumberValue",leader)
- bounti.Name = "Bounty"
- bounti.Value = 10000
- local Crew = Instance.new("StringValue",Player)
- Crew.Name = "Crew"
- local Pirates = Instance.new("Team",Teams)
- Pirates.Name = "Pirate"
- local Marines = Instance.new("Team",Teams)
- Marines.Name = "Marine"
- end
- local Script = game.Players.LocalPlayer.PlayerGui.HUD.FullScreen.ScrollingFrame.LocalScript;
- local connects = {}
- local gui = Script.Parent
- function selection_sort(tab)
- --Go through every position in the table
- for i = 1, #tab do
- --start minimum at current position
- local minimum = i
- --Go through the remaining elements that need to be sorted
- for t = i + 1, #tab do
- --compare current element to minimum
- if tab[t][2] < tab[minimum][2] then
- --t is the new minimum
- minimum = t
- end
- end
- --switch minimum with current position
- tab[i], tab[minimum] = tab[minimum], tab[i]
- end
- end
- function sortbounties(guis)
- local pirates = guis:GetChildren()
- local organize = {}
- local originals = {}
- for a,b in next, pirates do
- if b:IsA("Frame") then
- organize[#organize+1] = {b,b.BountyValue.Value}
- end
- end
- selection_sort(organize)
- for i=1,#organize do
- local b = organize[#organize-(i-1)]
- local tag = b[1]
- tag.Position = UDim2.new(1, -250, 0, 20*i)
- end
- end
- --
- local players = {}
- for a,b in next, game.Players:GetPlayers() do
- players[#players+1] = b
- table.foreach(players,print)
- end
- function Color4(r,g,b)
- r = r/255
- g = g/255
- b = b/255
- return Color3.new(r,g,b)
- end
- function teamupdate()
- local change = false
- for a,b in next, game.Players:GetPlayers() do
- local tag = gui:FindFirstChild(b.Name,true)
- if gui:FindFirstChild(b.Name,true) then
- local play = b
- local targparent = gui.Civilian
- if play.Team == game.Teams.Marine or play.TeamColor == game.Teams.Marine.TeamColor then
- targparent = gui.Marines
- elseif play.Team == game.Teams.Pirate or play.TeamColor == game.Teams.Pirate.TeamColor then
- targparent = gui.Pirates
- elseif play.Team == game.Teams.Civilian or play.TeamColor == game.Teams.Civilian.TeamColor then
- targparent = gui.Civilian
- elseif play.Team == game.Teams.Revolutionary or play.TeamColor == game.Teams.Revolutionary.TeamColor then
- targparent = gui.Revolutionary
- end
- if tag.Parent ~= targparent then
- tag.Parent = targparent
- change = true
- end
- end
- end
- if change then
- updateguisize()
- for a,b in next, gui:GetChildren() do
- sortbounties(b)
- end
- end
- end
- function updateguisize()
- --number of players/team changes
- local pirates = gui.Pirates:GetChildren()
- gui.Marines.Position = UDim2.new(1,-250,0,25 + (20*(#pirates-2)))
- local marines = gui.Marines:GetChildren()
- gui.Revolutionary.Position = UDim2.new(1,-250,0,45 + (20*((#pirates+#marines-4))))
- local rebels = gui.Revolutionary:GetChildren()
- gui.Civilian.Position = UDim2.new(1,-250,0,65 + (20*((#pirates+#marines+#rebels-6))))
- local civs = gui.Civilian:GetChildren()
- end
- function updatetag(tag)
- local play = game.Players:FindFirstChild(tag.Name)
- if play:WaitForChild("Crew").Value ~= "" then
- local info = game:GetService("GroupService"):GetGroupInfoAsync(play.Crew.Value)
- tag.ImageButton.Image = info.EmblemUrl
- tag.CrewName.Text = info.Name
- tag.CrewRank.Text = play:GetRoleInGroup(info.Id)
- tag.ImageButton.Visible = true
- else
- tag.ImageButton.Visible = false
- end
- tag.Bounty.TextLabel.Text = play.leaderstats.Bounty.Value
- tag.BountyValue.Value = string.gsub(play.leaderstats.Bounty.Value,",","")
- tag.TextLabel.Text = play.Name
- end
- local connections = {}
- local tags = {}
- function CreatePlayer(Player)
- local FakePlayer = Script:WaitForChild("Player"):clone()
- FakePlayer.Name = Player.Name
- FakePlayer.Bounty.TextLabel.Text = Player:WaitForChild("leaderstats").Bounty.Value
- FakePlayer.BountyValue.Value = string.gsub(Player:FindFirstChild("leaderstats").Bounty.Value,",","")
- FakePlayer.TextLabel.Text = Player.Name
- if Player:WaitForChild("Crew").Value ~= "" then
- local GroupInfo = game:GetService("GroupService"):GetGroupInfoAsync(play.Crew.Value)
- FakePlayer.ImageButton.Image = GroupInfo.EmblemUrl
- FakePlayer.CrewName.Text = GroupInfo.Name
- FakePlayer.CrewRank.Text = Player:GetRoleInGroup(GroupInfo.Id)
- FakePlayer.TextLabel.MouseEnter:connect(function()
- FakePlayer.CrewRank.Visible = true
- end)
- FakePlayer.TextLabel.MouseLeave:connect(function()
- FakePlayer.CrewRank.Visible = false
- end)
- FakePlayer.ImageButton.MouseEnter:connect(function()
- FakePlayer.CrewName.Visible = true
- end)
- FakePlayer.ImageButton.MouseLeave:connect(function()
- FakePlayer.CrewName.Visible = false
- end)
- else
- FakePlayer.ImageButton.Visible = false
- end
- Player.leaderstats.Bounty:GetPropertyChangedSignal("Value"):connect(function()
- updatetag(FakePlayer)
- sortbounties(FakePlayer.Parent)
- end)
- Player.Crew:GetPropertyChangedSignal("Value"):connect(function()
- updatetag(FakePlayer)
- end)
- Player:GetPropertyChangedSignal("Team"):connect(function()
- teamupdate()
- end)
- local rank = Player:GetRankInGroup(3159910)
- if rank == 235 then
- FakePlayer.TextLabel.TextColor3 = Color4(255,58,58) --Yonko
- elseif rank == 200 or rank == 255 then -- admiral
- FakePlayer.TextLabel.TextColor3 = Color4(102,168,255)
- elseif rank == 199 or rank == 190 then -- vice admiral
- FakePlayer.TextLabel.TextColor3 = Color4(84,238,255)
- elseif rank == 200 or rank == 160 then -- HR MARINE
- FakePlayer.TextLabel.TextColor3 = Color4(125,203,255)
- elseif rank == 220 then -- fleet admiral
- FakePlayer.TextLabel.TextColor3 = Color4(0,59,255)
- elseif rank == 225 then -- notable pirate
- FakePlayer.TextLabel.TextColor3 = Color4(255,252,140)
- elseif rank == 226 then -- Super Nova
- FakePlayer.TextLabel.TextColor3 = Color4(255,129,79)
- elseif rank == 230 then -- Shichi
- FakePlayer.TextLabel.TextColor3 = Color4(212,0,177)
- end
- if Player.Team == game.Teams.Marine then
- FakePlayer.Parent = gui.Marines
- elseif Player.Team == game.Teams.Pirate then
- FakePlayer.Parent = gui.Pirates
- elseif Player.Team == game.Teams.Revolutionary then
- FakePlayer.Parent = gui.Revolutionary
- else
- FakePlayer.Parent = gui.Civilian
- end
- b = b or false
- if b == false then
- updateguisize()
- sortbounties(FakePlayer.Parent)
- end
- end
- for a,b in next, players do
- CreatePlayer(b,true)
- end
- updateguisize()
- for a,b in next, gui:GetChildren() do
- sortbounties(b)
- end
- game.Players.PlayerAdded:connect(function(Player)
- if Player and Player:FindFirstChild("leaderstats") then
- CreatePlayer(Player)
- end
- end)
- game.Players.PlayerRemoving:connect(function(Player)
- if gui:FindFirstChild(Player.Name,true) then
- local tag = gui:FindFirstChild(Player.Name,true)
- local tagparent = tag.Parent
- tag:Destroy()
- updateguisize() --update bounty sizes
- sortbounties(tagparent) -- sort their bounties again SHO NAN DA
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement