Repeat fast at .1 wait but incredibly slow at .2

Im making gun full auto but when changing the speed from .1 to .2 it goes alot slower than it should for a .2 second wait

Video at .1 wait


Video at .2 wait

Heres the code: that does this stuff

tool.Activated:Connect(function() ------GUN SHOOTING!
	if isHeld == true then
		con[1] = mouse.Button1Down:Connect(function()
			if isLoading == false then
				if isShooting == false then
					isShooting = true
					repeat
						task.wait(.2)
						loadClick:Play()
						script.Parent.FireSound:Play()
						
					until isShooting == false
				end
				
			end
		end)
	end
end)

mouse.Button1Up:Connect(function()
	isShooting = false
	con[1]:Disconnect() 
end)

I assume you’re talking about wanting the speed of the gun to fire correctly. You could try changing the task.wait(.2) to something more like task.wait(0.15) This way, it’s not too slow, and not too fast. Hope this helps.

1 Like

Thank you I dont know why i didnt think of this

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.