I'm trying to make a PVP Gun Fighting Game, I can make UI, and get a local player's leaderstats, but how do I see which player has the most kills after a game is done, I'm also wondering how to make a UI on the top that displays the top 5 players.
I would show a code example, as i slightly understand how to get the time part working, and how to detect a leaderstat value, math.random and such.
I'm not trying to request, please help.
I would show a code attempt here but I don't know how I would get the script to work, here's my best try:
local UI = script.Parent
local Player = game.Players
local Start = game.ServerScriptService
local GameEnded = Start.GameEnded -- I dont care if u change up the variables.
if Start.GameStarting.Value == true then
UI.Text = "Game is starting in a few seconds..."
wait(1)
UI.Text = "Start!"
wait(1) -- i think there's a better way to make time work, I remember it but can't remember how to write it, something with for i,v in pairs.
UI.Text = "5:25"
wait(1)
UI.Text = "5:24"
wait(1)
UI.Text = "5:23"
wait(1)
UI.Text = "5:22"
wait(1)
UI.Text = "Finish!"
-- how would i scan for all player leaderstats and display it in a UI?
end
Explorer: -- GameUI --- Frame ---- Other Health UI stuff. ---- Top Leaderboard Bar, (5 Players) ---- Timer (Below Bar)
The script is inside the timer UI, and the values are just simply placed in ServerScriptService.

3 comments
Make sure to update the "mostKills" variable.
If you mean change it, yea after testing ill change it.
half works, i have problems with the playerWithMostKills, i havent fully finished it yet, and it may be other code issues. Ill accept once i get it to work.