Ok so I made a gun, semi auto works perfectly. I went into trying to make a full auto gun, it works except it doesn’t stop shooting. I am using Mouse.Button1Down
I did ~~~~~~~~~~~~~~~~~while Mouse.Button1Down do
shoot()
wait(.2)
end~~~~~~~~~~~~~~~~~
Can anyone tell me how to make it so it only shoots when the left button is down and it stops shooting when I stop holding down the button?
Thanks
Mouse.Button1Down
is an event. This means it will fire a function when the mouse button is pressed down. It does not return a boolean value of true or false. You want to make it so that a boolean variable is updated when the mouse is pressed down (or up) and then you can structure your code in a while loop like you have.
This is probably more along the lines of what you want:
local isButton1Down = false; mouse.Button1Down:connect(function() isButton1Down = true; end); mouse.Button1Up:connect(function() isButton1Down = false; end); while (isButton1Down) do shoot(); wait(.2); end;