How to use score as value in other command

Can I use score in another command.

Real Example: execute if score @p worldBorder < @p advCount run worldborder set advCount

I have no idea how to pull in the value for advCount

Full Code (so far):

#Set up scoreboards #deathCount takes care of incrementing everything so no more is needed here. scoreboard objectives add Deaths deathCount #scoreboard objectives setdisplay sidebar Deaths scoreboard objectives add advancements dummy #scoreboard objectives setdisplay list Deaths

#temp scoreboard to hold the count of advancments scoreboard objectives add advCount dummy #scoreboard objectives setdisplay sidebar advCount scoreboard players set @p advCount 0 execute if entity @p[advancements={adventure/kill_a_mob=true}] run scoreboard players add @p advCount 10 execute if entity @p[advancements={adventure/sleep_in_bed=true}] run scoreboard players add @p advCount 10 execute if entity @p[advancements={adventure/root=true}] run scoreboard players add @p advCount 10

... yup more to do

#Deaths now needs a scoreboard to be multiplied by... scoreboard objectives add deathPenalty dummy scoreboard players set @p deathPenalty 5 scoreboard players operation @p deathPenalty *= @p Deaths

#final world boarder scoreboard players operation @p advCount -= @p deathPenalty

#store the worldborder into a new scoreboard scoreboard objectives add worldBorder dummy execute store result score @a worldBorder run worldborder get

#run the worldborder update here execute if score @p worldBorder < @p advCount run worldborder set advCount **#<--- no idea what to do here... ** #then delete the scoreboard #scoreboard objectives remove advCount #scoreboard objectives remove worldBorder #scoreboard objectives remove deathPenalty

Continue to help post