|
| 14 Oct 2016 10:36 PM |
--Automatic gun script-- --how would I make it so that they can't spam Q to result in more projectiles p/wait()?
--If I were to spam Q 4 times very fast, then hold Q, it'd result in shooting 4 projectiles per wait(firerate) instead of just 1, which it should be--.
local Activated = false MyMouse.KeyDown:connect(function(key) if auto == 2 then if string.lower(key) == "q" then if ClipSize > 0 then if not reloading then if not Activated == true then Activated = true repeat wait(firerate) fire(player["Humanoid"].TargetPoint) until not Activated end end end end end end) MyMouse.KeyUp:connect(function(Key) if auto == 2 then if Key:lower() == "q" then Activated = false end end end) |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2016 10:39 PM |
I've tried adding wait for the keyup event, which just delayed the stopping and still allowed spam. i've tried putting the if thens inside the repeat wait() and it broke the automatic property. tried puting wait() and wait(firerate) after fire() and it still resulted in the spam. put wait() everywhere i could but that didn't prevent it.
what do i do |
|
|
| Report Abuse |
|
|
| |
|
|
| 14 Oct 2016 10:47 PM |
bump2
i am the best melon ever |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2016 10:49 PM |
http://wiki.roblox.com/index.php?title=Debounce
game.Players:findFirstChild("Stereotypical_Nerd"):WaitForChild("leaderstats")['Whiteness and Nerdiness'].Value=math.huge |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2016 11:06 PM |
i use debounces already
but the repeat wait() until completely ignores the 'activated' debounce and allows for stacking |
|
|
| Report Abuse |
|
|