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

My automatic gun will not work?

Asked by 3 years ago
Edited 3 years ago

So here's the deal; I tried making an automatic gun but failed. If I hold my mouse button it will work how I intended, but as soon as I spam the gun it shoots extremely fast. Is there any way fix to this? Any answer is appreciated!

Script (You might have to press view source for this one):

001--[[ Values ]]--
002-- Booleans
003local canIdle = true
004local canShoot = true
005local shooting = false
006local canReload = false
007local isRunning = false
008 
009local canStillShoot = true
010 
011-- Numbers
012local spread = 0
013 
014-- Ammo
015local maxAmmo = 30
View all 157 lines...
0
im gonna be honest, i kinda gave up when I saw you had 157 lines. Can you shrink the script a bit? Xyternal 247 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

On line 139 it shows what the values of ranSpreadX, ranSpreadY, and ranSpreadZ are. Just replace the ending part of the variable with = 5 or however fast you want the bullet to be going. If this didn't work let me know.

1
What I meant with the gun going very fast, is that the bullet just come out multiple times whenever the gun is being spammed. Thanks for the reply anyways! ColdFoxy07 76 — 3y
0
Try using debounce, sorry this answer didn't help. NotFrindow 346 — 3y
Ad

Answer this question