## init.mcfunction

scoreboard players reset @e[team=spectating] kills_this_game

tag @a[distance=..250] add checking_kills

#Copy over their raw score to a temporary scoreboard
execute as @a[tag=checking_kills,scores={kills_this_game=-2147483648..2147483647}] run scoreboard players operation @s rank.temp = @s kills_this_game

#Reset everyone's rank on the ranking scoreboard
scoreboard players reset * Rank

#Available rank holder
scoreboard players set #rank Rank 1

#Start a looping function
function pctf:logic/game/end/end_stats/kills/loop

#Display
function pctf:logic/game/end/end_stats/kills/display

tag @a remove checking_kills