Fixing a bug with camera when unequipping a gun

Hello everyone. Me and my team are making a tower defense game and decided to add guns to it. When we did (free model) it broke the camera when unequipping it. Does someone know how to maybe fix it?
(The local script inside the gun is made by me trying to fix the issue)
Model : SMG - Roblox

You made a simple mistake on line 13.

local ReplicatedStorage = game.ReplicatedStorage
local WeaponsSystem = ReplicatedStorage:WaitForChild("WeaponsSystem")
local weaponModule = require(WeaponsSystem:WaitForChild("WeaponsSystem"))
local camera = workspace.Camera
local player = game.Players.LocalPlayer

script.Parent.Equipped:Connect(function()
	weaponModule.camera:setEnabled(true)
	weaponModule.camera.rotateCharacterWithCamera = true
end)

script.Parent.Unequipped:Connect(function()
	weaponModule.camera:setEnabled(true) --// mistake is here (false)
	weaponModule.camera.rotateCharacterWithCamera = false
	
	camera.CameraSubject = player.Character
	weaponModule.normalOffset = Vector3.new(0,0,0)
end)

Thank you. I will test if it works right now.

I didn’t edit the code so make sure you set it to false after the unequipped event for it to work