I’ve seen lots of people having problems with Roblox’s Weapons Kit, mostly with its very annoying issue of locking your camera in 3rd person mode and over your shoulder. I’ve seen some fixes for this, but most lead to more issues, leave some unattended, or aren’t very easy to implement. I myself used this kit in one of my old games, so I decided to make a (probably) complete fix for this weapon kit’s system.
Here is the public model of which you can easily add to your game:
Roblox Weapon Kit Fix - Creator Store
This fixes many issues, with big ones such as:
- Your camera when unequipping the weapons goes back to normal! No FOV, MoveSpeed, or tilt issues either.
- Fixed issues with not being able to damage R6 rigs or non-player humanoids.
- Fixed issues with explosion damage not being displayed correctly.
Some of the Code That I Modified
'ServerWeaponsScript' Server Script:
- Lines 53 - 78 : I removed all of the weapon's if-statements for checking if the WeaponsSystem is already loaded, and just copied their "initializations" to the new "customInitialize()" function.
'ShoulderCamera' Module:
- Lines 218 219 : 2 new values. 'self.tiltFix' is used to fix a tilt issue when you would unequip your weapon.
'self.forceStop' is used to stop the shoulder camera from activating when the player is dead (and potentially locking themselves in shoulder camera)
- Lines 309 - 317 : Here is where all the fixing magic happens. I disable all the current "Springs" that smoothly change the camera's FOV and the player's walkspeed.
I then use some small custom functions to reset their values to the default (so that your walkspeed and FOV will go back to normal)
- Line 553 : Return type 'boolean' added to the function. This helps to fix stuff explained further here.
- Lines 548 - 552 : Prevents an issue for when the player equips a weapon while their joints are broken (AKA: dead), as the
'self.currentWaist = character:WaitForChild("UpperTorso"):WaitForChild("Waist")' line would provide an infinite yield (as there is no 'Waist' joint when the player is dead!)
This will also return false to let whatever code know that called the function that this is not a valid characterChange.
- Lines 581 - 584 : When the player dies it will call one of my custom functions setForceStop(false) to force the player to not go in shoulder camera mode.
- Lines 243 - 253 : Now that the shoulder camera isn't always active, we have to prevent the camera from still being activated when the player dies (or when they load again they will be locked in it again)
If the characterChange wasn't valid, we will have to force the player to not go into shoulder camera mode by calling one of my custom functions setForceStop(false).
- Line 820 : One issue I encountered with all of these fixes is that the crosshair would still be active even when we disable the shoulder camera on death (because self.zoomState would be false),
causing the crosshair to be set active to 'not false' AKA: true. So one of the main reasons to add self.forceStop is to prevent this and to force the crosshair to not be active on death.
- Lines 1023 - 1043 : Here are those short custom functions to reset the player's values back to normal. You have to pass the value's parameters as for some reason
trying to access the self.currentCamera or self.currentHumanoid gives you nil references at that point.
'WeaponsSystem' Module:
- Line 185 : The player's camera will now default to regular (which means it will only go into the "Shoulder Camera" when equipping one of the weapons)
- Lines 409 - 415 : Added an if-else statement to disable/enable the Shoulder Camera based on whether or not the weapon was just equipped/unequipped
- Lines 418 - 423 : Fixed an issue with trying to damage humanoids that didn't have their Model have the PrimaryPart set as the HumanoidRootPart
- Lines 503 - 514 : Modified slightly so that explosions will show the correct damage dealt, as previously it would just show the BlastDamage without the distance damage reduction taken into account.
- Line 796: Changed from "UpperTorso" to "HumanoidRootPart" so that it will hurt R6 players + NPCs
'DirectionalIndicatorGuiManager' Module:
- Lines 52 - 59 : Now that the players have the ability to not always have a current Shoulder Camera, I had to prevent the code from trying to display a damage
indicator to a player who just got hurt by a weapon but doesn't have the Shoulder Camera (or else it would give annoying warnings and errors)
'BaseWeapon' Module:
- Line 121 : Commented this out as it caused an issue. When a player would join and an existing player had a weapon equipped, it would give the joining player the shoulder cam which is of course not good.
The full explanation is commented on the lines behind it.
And that is all! (other than some commented out print statements of which I used for debugging, or probably some small stuff I forgot, which might also mean the line numbers might be slightly inaccurate).
If you find any issues, please tell me and I will try my best to fix it. If you have any QOL ideas, also tell me and depending on how reasonable it is I will add it. Also, if you made your own or found some other assets that work well with the Roblox Gun Kit, tell me and I might add it to the “Add-ons” list.
Other Add-ons
- Gun Kit Leaderboard Asset | Tracks kills, headshots, deaths, and awards points with the Roblox Weapon Kit weapons. Also has leaderstats and save system.
- Player Radar | If you have a game with guns, then you might want to have a player radar like in COD or other shooter games! This asset was made by me and comes with lots of customizability and clean code.
Edit: Updates to the kit will be listed in the “READ ME” script of the asset, and I will periodically edit this post to include updated stuff also.
Current Version Number: v1.03