You are asking the dev forum to create a script/tutorial, which is off-topic. However, browse through the roblox dev forum resources to find tutorials on raycasting. I also recommend reading through the roblox developer article on raycasting (this is where I first started). Also, check out this raycasting tutorial on youtube. And lastly, if you want to make a good gun, check this tutorial out. It’s pretty long, but it covers a lot of the raycasting stuff.
Trust me, raycasting is not as hard as it looks. I spent weeks researching it (there was no proper documentation at that time), but I got there eventually. It is pretty simple stuff. All you are doing is selecting a point, giving it a direction, and seeing where it hit. It is much more flexible than that, so experiment with it.