I have a gun that is mostly custom scripted and I am stumped to no end with how to make it automatic. I want the user to be able to hold down the mouse like most guns. Can someone please give me an example or point me in the right direction. I have played around quite a bit with some remade scripts and I don't understand how the automatic shooting aspect works at all.
COMMUNITY QUESTION
How do I make an automatic fire?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
It's a bit hard to explain, but you could have a variable set to when a player's holding down the mouse the variable's set to true, and a loop is starting for the automatic, and when the player releases their mouse, the variable is set to false, thus stopping the loop. ^^
^ Like he said you've got two events of mouse being Button1Down and Button1Up, set a bool, while the bool is true shoot the gun
This is a really simple test I made in a script (not local script) to make sure I understand the mouse:
local mouse = game.Players.LocalPlayer:GetMouse() mouse.Button1Down:connect(function(destroy) game.Workspace.Baseplate:Destroy() end)
Will that work?