Just like @DonKingFrog said, you just need to get the biggest value (Kill) from the player, and make a function that UI will be show who has the biggest value
And if you don’t understand how I get career kills this is how:
When Player enters add a IntValue to their player named CarrerKills:
game.Players.PlayerAdded:Connect(function(Player)
local CarrerKills = Instance.new("IntValue",Player) -- Makes Int Value / Places inside Player
CarrerKills.Name = "CarrerKills" -- Sets the name
end)
And every time a player kills someone adds a point:
function killedPlayer(Player)
Player.CarrerKills.Value += 1 -- Adds 1 to whatever is inside it
end)
local gui = game:GetService("StarterGui").ScreenGui.Frame
game.Players.PlayerAdded:Connect(function(Player)
local CarrerKills = Instance.new("IntValue",Player) -- Makes Int Value / Places inside Player
CarrerKills.Name = "CarrerKills" -- Sets the name
local char = Player.CharacterAdded:Wait() or Player.Character
local hum = char:WaitForChild("Humanoid")
hum.Died:Connect(function()
local tag = hum:FindFirstChild("creator")
local killer = tag.Value
killer.CarrerKills.Value += 1
end)
end)
function loadWin(Player)
local CarrerKills = gui.CarrerKillText -- Carrer Kill Textlabel
local UsernameText = gui.UsernameText -- Username TextLabel
local WinnerIcon = gui.WinnerIcon -- Player ImageLabel
local Thumnail = game.Players:GetUserThumbnailAsync(Player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size100x100)
--Gets Player Thumnail--
WinnerIcon.Image = Thumnail -- Sets Icon
UsernameText.Text = Player.Name -- Sets Username
CarrerKills.Text = Player.CarrerKills.Value --Sets CarrerKill
end
while wait() do
loadWin()
end
Is there any other we that we can contact so you can show me how to solve that or what?
► Adding IntValue
► Adding Values to CarrerKills
► Fire Remote Event when the round ends sending Winner
Client-Sided
► Recieve the Remote Event with the Winner Player
► Using the function with a given player once
► Don’t use a while loop it’s unnecessary since the text will stay the same till the next round ends.