Couldn’t you use built in stats? They have “Player Hero Stat” as a value you can use. So like you could call straight for it inside a hud.
Player Hero Stat(Local Player, Hero Of(Local Player), Shots Fired)
or if you want to save the variable somewhere you could do that too, but use Event Player obviously.
They also have stats for shots missed, and shots hit, and even scoped shots.
A few problems with these stats depending on what you want them for:
*These stats don’t track if the game is not considered in progress. (if you use skirmish, don’t worry they consider that in progress so the stats count)
*They also will stay the same on the hero they were on previously if they were to swap and then swap back, which could be useful or not, but if you wanted to reset the stats for the hero, then you could probably save this stat inside a variable, adding the difference or something every time it’s updated, then if they swap heroes, reset that variable back to 0.
*Shotgun type weapons count literally every bullet that is shot out of 1 ammo. (for these heroes you could just divide the stat by the ammo that you know each character shoots, such as d.va shoots 11 shots per gun in her mech, and reaper shoots 20 bullets per shot, so what we could do is say if reaper shot 4 times, it would say 80 shots were fired, divide that by 20, it should now say 4 shots were fired, if you were displaying this in a hud, use if-then-else, check if hero of (event or local player) = hero, d.va, then divide the stat by 11, and then do another if-then-else in the else checking for each shotgun hero.
*The display of these stats update every few frames, so it won’t see a smooth increase if you were shooting shots with bastion, but it is 100% accurate on the shots they shoot.
*These stats don’t track on dummy bots.