So, I've written a function for fully automatic fire, but the delays between shots are quite a long time (probably less than a second, but still slow for automatic.) I'm wondering if the loop is waiting for the function to finish to fire the next shot, and if it is, how do I stop it?

--Start automatic fire
local function startAuto()
	while mouseDown and fullyAutomatic and equipped do
		fireBullet()
		wait(fireTime)
	end
end

Edit: It's definitely waiting for the function to finish. How do I stop this?

4 comments

0

It will wait for the function to end before looping...is fireTime greater than 0?

0

fireTime is 0.01 at the moment. I put a print between the fireBullet and the wait and realized that it's waiting before it prints, even though it's not being told to wait yet.

0

When you call a function the script is naturally going to wait for it to end before it continues, I would use wait() instead of wait(0.01) first...also are there any waits within fireBullet?

0

No waits within fireBullet, but it's processing a bit of stuff and firing RemoteEvents (no RemoteFunctions). I know the script is capable of having multiple fire bullets run in quick succession though, as the gun fires as fast as you want in semi-automatic.