How would you make a "Most Kills" Script/Gui

You have to define them both…

local PlayerWithMostKills

then set it later.

The function you just simply change the name to match,

function GetPlayerWithMostKills()

GetPlayerWithMostKills()

'''
      function GetPlayerWithMostKills()
      local current, plr = 0, nil

      for i, v in pairs(game.Players:GetChildren()) do
      if v.Kills.Value > current then
      plr = v
      end
      end

      return plr
      end

      --when round ends
      PlayerWithMostKills = GetPlayerWithMostKills()

print(player.Name)

      '''

something like this?

Would this print the players name, if they get the most kills?

Also, how would you show the player who got the most kills avatar? (I already have a script for showing the avatar. But I need it to show if the player got the most kills, and if the round is over)


This is what the kills Gui looks like

Is it normal to print nil if you don’t kill anyone?