Use a remote event to tell the server to shoot, and shoot in the server by casting a ray and damaging the ray result. You can find a lot of resources online about this
I recommend FastCast for this. Its open source and great.
Client presses mouse button 1 down
Client sends to server
Server checks if client actually has gun
If does, redirect that to a module or something that can control the shooting.
Module responds by creating a bullet with FastCast, and sets settings depending on the gun
Module connects fastcast events like position changed, ray hit, pierced, etc.
If you dont want to use fastcast i guess maybe replicate FastCast by creating a bundle of rays that go along the bullets trajectory and tell you when they pierce something and then you can handle it by either creating bulletholes or damaging any humanoids if hit.
Edit: had to do smth, heres Fast cast Making a combat game with ranged weapons? FastCast may be the module for you!