So I was looking at this free model rifle script from toolbox and wanted to improve some aspects of it. I took some of BlackShibe’s code to use the amazing fastCast module and replicate the bullets, bullet shells, sound, flash and (Head, Torso and Hand following thingy) to all the clients without putting unnecessary pressure on server. Also used the great Spring module for the camera recoil
Mouse look:
Weapon Aiming:
Weapon Firing:
Of course the first person can’t compete with viewmodels as the hands are still attached to the rig. But not making double animations for each gun is a nice plus I guess. The hand shaking will definitely depend on the character running animations.
I’m sure there exists an interpolation formula that would make the left arm movement flawless. Too lazy to figure that out (let me know if you do, pretty please?). I could’ve disabled the motor6d of the left shoulder and weld the left Hand to the gun and return it back to normal while reloading…but hey I’m lazy.
CAUTION: It lacks any functional server security (except damage). Which means any eager enough individual can change the fire rate and mag capacity, range, velocity inside the game as they please. So as you can tell, this isn’t a full on game ready script and more of a learning resource.
Enjoy!
Third Person FE Gun Script.rbxl (85.1 KB)
Excuse me for not rewriting the code in OOP
Edit: In case anyone needs the animations animations.rbxl (30.7 KB)