Modifications to the ROBLOX OTS gun system

Recently I’ve been experimenting on the ROBLOX gun system and have been modifying some code for it to work better in my game.

#1. Ready Position

In the default version of the gun system, the character is always aiming their firearm when the gun is equipped. I modified it where the character will hold the gun until the player starts to aim. When the player is ready the crosshair will be invisible. The crosshair will also be invisible if the character is reloading. I’ve also modified some of the animation code as the animation seemed to be glitching towards other players.
https://gyazo.com/7727dbfa2ecc19c8f4bce2a36cf6a7a8

#2. New ammunition GUI + New limited ammo feature

I’ve made it so that the gun’s ammunition would be displayed in the GUI and will update when the player fires or is reloading the gun. I’ve also made a new feature for limited ammo for very heavy weaponry that are just more powerful. Once the stored ammo is used up the gun can no longer reload or fire.
https://gyazo.com/c5b3a3b4dcc4c0ac3751b508a2830fb0

#3. Zooming

Players can now zoom when the gun is equipped. This is simply for the player’s experience and for combative purposes. (Player may be better at combat when zoomed in rather than zoomed out and vise versa.)
https://gyazo.com/2d70a0697d1a399b3f36b31a0af0d909

#4. Headshot indicators

When a bullet hits a player’s head the crosshair will appear red and a headshot sound effect will play on the client side. (Target player did not die because of friendly fire being turned off.)
https://gyazo.com/3a159e653974db9c4e193d8c544f7c35

#5. Sprinting overriding aiming

When the player is aiming and sprinting, the player will stop aiming and gain an increase of walkspeed.
When the player is reloading, sprinting will be disabled and will be enabled when the player has stopped reloading or has unequipped the weapon.
https://gyazo.com/27163363103a6cb3e964c04ed476edd8

#6. Realistic light from gun

I’ve made it so that when the player has fired a shot, light will be emitted from the gun to make it more realistic. This way enemies in the dark won’t be undetectable when they fire their weapon.
https://gyazo.com/60394a3c0963cf7211223f19e284d1fb

I also made some minor adjustments but I didn’t want to put them in this post.
The Modifications I’m working on are still in beta
Thanks for reading, feel free to make any suggestions!

5 Likes

You can make the script changes u made open source. And would like to see better reloading system

I didn’t like that ready position feature but it gave me a idea. Like other third person shooter, the character play s rest position if he had not been aiming or shooting for a while.And the zooming, it must be used in zoomable optics or snipers only like sniper fury and right click must only be used for aiming.

I did not make the modifications open sourced because I am constantly updating everything. As I have said before, the modifications are in beta and some are exploitable. I’m currently trying to fix this. Zooming is disabled for guns that have a scope.