So as I described in the title, the gun is fully functional, but when you double(or more) click and hold it's like it's running multiple threads. I've tried adding debounces but I'm still puzzled. The problem is at the mouse.Button1down function (at the bottom). Let me know you if have any alternate ways of scripting this. Thanks :)
function fire()
--Cloning stuff, direction ETC, everything's working here
end
local button1down = false
function Active()
while button1down == true do
local player = game.Players.LocalPlayer
local humanoid = player.Character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
wait(.3)
fire()
end
end
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Button1Down:connect(function()
button1down = true
Active()
end)
mouse.Button1Up:connect(function()
button1down = false
print('off')
end)

2 comments
You have an unneeded ) for the active() end, your tick setup doesn't even work. Tried printing to see when it gets stuck, and it's definitely the tick. Thanks for trying.
Nvm, did it myself.