Weird issue causing players not to fire weapon

This is very weird, I haven’t seen anything like this and I don’t really know what to look up considering that the console is not printing any errors. (or really printing anything at all when adding print statements)

Basically, the issue I’m having is that when a player goes to equip a weapon and goes to shoot their weapon it won’t register as a click at all even with print statements. I am using fastcast for the method of firing the weapon. Here is the server sided code for the weapon firing.

Also, this bug is fairly rare as it’s only happened twice.

FireEvent being called from the client on left click:

FireEvent.OnServerEvent:Connect(function(player, mousep, Weapon)
	Weapon = player.Character:FindFirstChild(Weapon.Name)
	if not Weapon then return end
	local WeaponSettings = require(Weapon.Settings.Modules.Settings)
	if Equipped == true then
		local o = (mousep - Weapon.Barrel.Fire.WorldPosition).Unit
		if WeaponSettings.Stats.Selected == "Shotgun" then
			for i = 8, 0, -1 do
				fire(player,o, Weapon)
			end
		else
			fire(player,o, Weapon)
		end
	end
end)

Fire Function:

local function fire(player, direction, Weapon)
	if Equipped == true then
	
	Weapon = player.Character:FindFirstChild(Weapon.Name)
	if not Weapon then return end
	local WeaponSettings = require(Weapon.Settings.Modules.Settings)

	if WeaponSettings.Stats.Selected == "Water" then
		bullet.Trail.Color = ColorSequence.new(Color3.fromRGB(0, 166, 255))
	elseif WeaponSettings.Stats.Selected == "RPG" then
		spawn(function()
			Weapon.Mag.Transparency = 1
			wait(0.1)
		end)
	else
		bullet.Trail.Color = ColorSequence.new(Color3.fromRGB(255, 89, 89))
	end
	
	castBehavior.CosmeticBulletTemplate = bullet
	
	local directionalCF = CFrame.new(Vector3.new(), direction)
	local direction

	direction = (directionalCF * CFrame.fromOrientation(0, 0, Random.new():NextNumber(0, math.pi * 2)) * CFrame.fromOrientation(math.rad(Random.new():NextNumber(1, spread)), 0, 0)).LookVector

	caster:Fire(Weapon.Barrel.Fire.WorldPosition, direction, WeaponSettings.Stats.Velocity, castBehavior)
end

Please Note:

these are simplified scripts, I excluded anything that was practically useless to bullet being fired.
Swapping weapons does not fix this either

Local script is just a RunService to detect if a player is holding down left click and it passing the parameters to the server and the firing animation.
the local script has a debounce as well

Hi, at the end of the fire function, you never told it to fire. Unless that is one of the things you cut out, put fire(), of course with the arguments needed in the ().

i told it to fire in the first script above

Both are in the same script?

-Grayseon

The gun works, the bug is just rare and i don’t know why it’s happening.

To answer your question, yes, they are in the same script.

In that case I’m not sure what is happening… however it could just be the weapon not found.

And if it were to be the weapon not found, then it would never return an error because you are running if not Weapon then return end

i didnt think about that, I’ll try to replicated this bug