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.

5 comments

2

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. ^^

0

^ 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

0

This is a really simple test I made in a script (not local script) to make sure I understand the mouse:

0

local mouse = game.Players.LocalPlayer:GetMouse() mouse.Button1Down:connect(function(destroy) game.Workspace.Baseplate:Destroy() end)

0

Will that work?