DISCLAIMER: Because some people may point it out, I made a post about this before where I actually tried to modify the scripts, it didn’t work so i asked for help on the devforum and didn’t recieve much. I thought about it for some time and realized i scripted it incorrectly and found my errors and wanted to do it correctly this time but I didn’t know how to so here’s this.
The Roblox Weapons Kit comes with a Weapons Gui with a crosshair so I deleted all the code that had to do with a crosshair and made my own Gui with custom crosshairs and made it so that every gun had a localscript inside that enables a specific crosshair for each gun. I used StarterGui to store the UI and cloned it instead of just having the gui’s stored inside the gun (tool) because I wanted a dot to appear in the center of the screen (even when a player isn’t holding a gun) and when a player switched guns it would either remove that dot (for snipers) or add something like a cross or reticle around the dot (for ARs and Shotguns).
This worked well but I also wanted to make them interactive, kind of like the FE Gun Kit or Fortnite where if you move/turn around with an AR for example, the crosshair would spread out a little, or when you aim in, the crosshair zooms/aims in as well.
Now, I didn’t know how to detect if the player was aiming in or not because thats in the shoulder camera module and I also didn’t know how to detect how much the crosshair should spread whenever a gun is shot because that is in the “BulletWeapon” module.
I want to do all this through LocalScripts because I feel like it would be too hard to implement this in OOP (and it would be better for organization because I am adding custom weapons that arent guns that I want to add custom crosshairs to as well).
This would also mean that instead of storing the Gui with the crosshair in it and cloning them, I would create whole new Gui’s for crosshair specific to that gun, store it inside the gun, and enable it whenever the gun is equipped (this would also allow me to add other info in the gun such as how much ammo it has, etc, which I already know how to do)
I am sorry if I spoke too much and I really hope somebody takes the time to read all of that. Thank you.