scoreboard players operation @s credits += @s kills_this_game
scoreboard players operation #kill_credits temp = @s kills_this_game

scoreboard players operation @s temp = @s flags_stolen_this_game
scoreboard players set #flag_mult temp 3
scoreboard players operation @s temp *= #flag_mult temp
scoreboard players operation @s credits += @s temp
scoreboard players operation #flag_credits temp = @s temp

execute if entity @s[tag=winner] run scoreboard players set #win_credits temp 10
execute if entity @s[tag=!winner] run scoreboard players set #win_credits temp 0

execute if entity @s[tag=winner] run scoreboard players operation @s credits += #win_credits temp

scoreboard players set #playing_credits temp 15
execute if score #game_end temp matches -1 run scoreboard players set #playing_credits temp 0
scoreboard players operation @s credits += #playing_credits temp

scoreboard players reset #total temp
scoreboard players operation #total temp += #kill_credits temp
scoreboard players operation #total temp += #flag_credits temp
scoreboard players operation #total temp += #win_credits temp
scoreboard players operation #total temp += #playing_credits temp

playsound minecraft:block.chain.break player @s ~ ~ ~ 1 0

scoreboard players operation @s lob_pre = @s credits

function pctf:logic/game/end/rewards/display