scoreboard objectives add scalingscore dummy scalingscore
scoreboard players add @a scalingscore 1
execute @r[scores={scalingscore=20..}] ~ ~ ~ function scalecmd
execute @r[scores={scalingscore=20..}] ~ ~ ~ scoreboard players set @a scalingscore 0