Mouse Input still gets detect even if tool is not equipped

The Tool.Equipped event, has a parameter which is the mouse. You can pass in the mouse through that parameter, and connect it with your Mouse.Button1Down and Mouse.Button1Up Events.

tool.Equipped:Connect(function(mouse) -- Connect mouse with your events end) 

Also, Humanoid:LoadAnimation is deprecated, so you should be using Animator:LoadAnimation instead. An example of how you would use it here is:

local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local Humanoid = character:WaitForChild("Humanoid") if Humanoid then	local Animator = Humanoid:FindFirstChildOfClass("Animator") -- Get the Animator	if Animator then	track = Animator:LoadAnimation(HoldAnim) -- Load the animation	track2 = Animator:LoadAnimation(ShootAnim)	end end