Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why won't this function Repeat?

Asked by 9 years ago

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)
0
Anything in the Output? woodengop 1134 — 9y
0
Nope ScriptingCon 52 — 9y
1
The error is maybe in your module. XToonLinkX123 580 — 9y
0
^ woodengop 1134 — 9y
View all comments (3 more)
0
There's no Error, everything is working good ScriptingCon 52 — 9y
0
Is this a LocalScript? Mouse objects don't work if not in LocalScripts. adark 5487 — 9y
0
Yep ScriptingCon 52 — 9y

Answer this question