scoreboard players set @a[scores={magGlock=17},nbt={SelectedItem:{components:{"minecraft:custom_data":{weapon:"glock"}}}}] shiftreload 0

execute as @a[scores={shiftreload=2..},nbt=!{SelectedItem:{components:{"minecraft:custom_data":{weapon:"glock"}}}},tag=glockReloading] run function ray_demo:reload/glock/reset
execute as @a[scores={shiftreload=0},nbt={SelectedItem:{components:{"minecraft:custom_data":{weapon:"glock"}}}},tag=glockReloading] run function ray_demo:reload/glock/reset
execute as @a[scores={shiftreload=2..},nbt={SelectedItem:{components:{"minecraft:custom_data":{weapon:"glock"}}}},tag=!glockReloading] run function ray_demo:reload/glock/reset
execute as @a[scores={shiftreload=2..,glockCD=1..},nbt={SelectedItem:{components:{"minecraft:custom_data":{weapon:"glock"}}}}] run function ray_demo:reload/glock/reset
execute as @a[scores={shiftreload=1..,magGlock=..17,glockCD=..0,9mm=1..},nbt={SelectedItem:{components:{"minecraft:custom_data":{weapon:"glock"}}}}] run tag @s add glockReloading