Chances are high that there are already Plugins out there doing actions like you described. In short, I can tell you a solution that only requires eventing. When you are a beginner in MV then it could be a little bit difficult but it will teach you a lot of what RMMV can.
Make a Event with parallel process. It wont work well as Common Event, because with all the Variables and Event IDs some parameters are map-specific. Then make a Event that represents the bullet.
The bullet event (parallel process):
Place it at any location of your map. With eventing we can spawn it at the Player's position. The even't page should have a switch as condition so the bullet is only visible when the Player fires.
The main event (parallel process):
Using IF statements you can check if a specific key is pressed. Using Plugins you can expand it and use eg. the Ctrl button. But lets keep it simple and use Space. Once the player presses that key, you do this (roughly)
- store X, Y coordinates and direction of the Player using Variable OPs
- There's a command to move an event to specific position. Call this command and use the variables we just stored. Using a Move Event you can turn the bullet into the player's direction.
- Make some switch OP to activate the bullet event.
- by the way, once you gained more practice, you can use this switch as condition to not fire twice within a very short time
Now we go back into the bullet event:
- store its X, Y coordinates using Variable OPs
- the following must be repeated for each guard. So for each guard, you store their X, Y coordinates, too.
- using IF conditions, you can check if the bullet's X any Y coordinates are identical. Then you got a hit.
- you need some mechanism to erase the bullet and allow the Player to fire again. Turning off the Switch could do the trick.
Well, this is a very briefly instructions to do it. You may need some hours until everything works fine. But then you have learned a lot about RMMV to improve this mechanic. Like, the bullet should dissappear when it hits a wall.
Well that could work indeed, the thing I am a bit worried about with this method is that I'm gonna have maybe hundreds of Guards during the whole game, so I would have to individually store their coordinates all the time ?
Ah okay, well then you should look if there's a Plugin out there or, if not, make a request in JS forums. I bet you are not the first planning to do this mechanic, so there should exist. a Plugin