Ay bois, in my game, you need to shoot some cubes to get money and some other things. The problem here is, when one enemy spawn, he will spawn with an pistol, and, the code that i made works perfectly with the position of it. BUT, when another enemy spawns, his pistol will glitch, and, lock in the place where he just spawned. So, if i have more than 1 enemy spawned, the pistol of the 2 enemy and above will glitch and lock, i tried using UID, but, didn't worked, i tried using iid, and, worked perfectly, BUT, when you kill one cube, everything screws off, i tried using my own created ID, but, like the UID, it glitches anyway. I tried using everything that i thinked, but, i don't know if is an wrong position of the code( lol what a coicidence in event sheet too. ), or the code is wrong, i'm using for each but, it seems to not work too. Please, if you know how to fix it, tell me!
Code: imgur.com/a/psf4B6h
Error: imgur.com/a/qmjLe8N