## rank.mcfunction

#first line protects multiple people getting the same rank
execute if score #ranked rank.temp matches 1 run return 0

#Grab available rank
scoreboard players operation @s Rank = #rank Rank

#Advance available rank
scoreboard players add #rank Rank 1

#Reset score on temporary scoreboard
scoreboard players reset @s rank.temp

#Protection from multiple people getting the same rank
scoreboard players set #ranked rank.temp 1 