This shooting function won't repeat at all

local GunModule = require(script.Parent.GunModule)
local plr = game.Players.LocalPlayer
local char = plr.Character
local mouse = plr:GetMouse()
shooting = false
local rof = 0.1
local shot = Instance.new("Sound", char.Torso)
shot.SoundId = "http://www.roblox.com/asset/?id=150763503"
shot.Volume = 1
mouse.Icon = "http://www.roblox.com/asset/?id=68308747"

function Shoot_test()
shooting = true
repeat
wait(rof)
shot:Play()
GunModule.PrimaryFire1()
until shooting == false
end

function Stop_test()
shooting = false
end


mouse.Button1Down:connect(Shoot_test)
mouse.Button1Up:connect(Stop_test)

7 comments

0

Anything in the Output?

0

Nope

1

The error is maybe in your module.

0

^

0

There's no Error, everything is working good

0

Is this a LocalScript? Mouse objects don't work if not in LocalScripts.

0

Yep