Can't figure out what to do from here

WHAT I’M TRYING TO ACCOMPLISH

https://gyazo.com/501cd813d78c92d9630cf21ec19f49d8

I’m trying to make a gun system (Napoleonic genre) and i’m having trouble with getting the projectile to actually follow the direction of the mouse from an attachment on the barrel of the model.

I’ve done all the animations, and have made a “reloading” system too for this weapon.

image

image

ISSUE

I want to find out how to make the projectile “spawn” at the attachment part, and then fly forward like it’s coming out of the barrel.

CODE

Local Script:
image
The local script is just for user input, and all that sort of stuff.

When the player reaches a certain stance and click, it will fire hopefully fire out a bullet and fires to the server getting the bullet to clone and parent to the attachment.
Attachments below:

Server Script:
image

Pretty simple stuff but i’m really stuck on how to actually get the bullet out and working, hopefully you can help!

The bullet is in replicated storage, and is placed in the folder with the pistol animations shown below:
image

First of all, if you want to set its position, you don’t do on the fire event, you don’t say + Attachment.Worldposition, you just say = Attachment.Worldposition, second of all. Try to do as much on the client as possible, and read mouse devhub page Mouse | Roblox Creator Documentation to get the end position. Second of all read up on your formulas, (Pos1 - Pos2).Unit = direction, and don’t use ApplyImpulse. If you are a newbie to scripting I recommend just using a body velocity BodyForce | Roblox Creator Documentation. And do not manage projectiles on the server, use modules as much as possible and replication. ModuleScript | Roblox Creator Documentation, replication simple tutorial: Working with the Replication Boundary.

Thanks for responding, i’ve not really worked with velocity or much position oriented stuff yet, so i’m pretty bad at this type of scripting.
I’ll look into those pages you sent me, and hopefully they help.