scoreboard players set #bool bool_score 0
execute on attacker store result score #bool bool_score if entity @s[tag=clicked]

execute if score #bool bool_score matches 1 at @s run function pctf:logic/game/flag/grab

execute if score #bool bool_score matches 1 run data remove entity @s attack