So I made a laser gun that shoots every 0.005 seconds (In roblox time) but the problem Is where the Local script doesn't shoot when your holding the mouse down
Local script:
local player = game.Players.LocalPlayer
local FireEvent = script.Parent:WaitForChild("FireEvent")
local mouse = player:GetMouse()
local debounce = false
mouse.Button1Down:Connect(function()
if not debounce then
debounce = true
FireEvent:FireServer()
print("The lasergun has shot a bullet")
wait(0.005)
debounce = false
end
end)

5 comments
i will re code it
Explain what you want to do, I can't understand.
so do this:
?
local Gun = script.Parent local RS = game:GetService("ReplicatedStorage") local FireEvent = RS:WaitForChild("FireEvent") -- put it in repstorage local Repeat = true local player = game.Players.LocalPlayer Gun.Equipped:Connect(function(mouse) mouse.Button1Down:Connect(function() if Repeat == true then Repeat = false print("The lasergun has shot a bullet") FireEvent:FireServer(Gun.Handle.Position,