$execute unless score @s scientist.capital matches $(scientists).. run return 0
scoreboard players operation @s pay += @s scientist.capital
execute at @s run function ws:work/misc/tier2/scientist/displaypay with entity @s
scoreboard players reset @s scientist.capital