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

When mouse is HOLDING?

Asked by
Netflixy 126
8 years ago

So, I'm making a gun script, and I'm having trouble automating the gun. How can I make repeatingly shooting while holding the mouse button?

1
Include some code so we can help you Shawnyg 4330 — 8y
0
Theres no need for any code. I'm asking how can I make a function rapidly fire when mousebutton1 is holding down Netflixy 126 — 8y

1 answer

Log in to vote
3
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
8 years ago

The way I'd approach it, is by creating a variable holding. Then set up 2 events, Button1Down and Button1Up, then simply toggle holding correspondingly. In your fire function, have it keep shooting white holding is true.

0
I can't get it to work :| Netflixy 126 — 8y
Ad

Answer this question