execute as @a[scores={mp5CD=1..},nbt={SelectedItem:{components:{"minecraft:custom_data":{weapon:"mp5"}}}}] store result score @s randomMP5 run random value 1..4
scoreboard players operation @s animation.calculator = .mp5shoot animation.calculator
scoreboard players operation @s animation.calculator += @s randomMP5
execute as @s[nbt={SelectedItem:{components:{"minecraft:custom_data":{weapon:"mp5"}}}}] run item modify entity @s weapon.mainhand ray_demo:animate

