-- Stops a confetti from firing again once it's out of bounds.

function _Confetti:Toggle()
	self.Enabled = not(self.Enabled);
end;

_Confetti.setGravity(Vector2.new(0, 1));

local Conffetis = {}

for _ = 1, 10 do
	
	table.insert(Conffetis, (_Confetti.createParticle(Vector2.new(0.5, 1), Vector2.new(math.random(90) - 45, math.random(70, 100)), script.Parent.Parent)))
	
end

local Debounce = false

RunService.RenderStepped:Connect(function()
	
	for _, Conffeti in pairs(Conffetis) do
		
		Conffeti.Enabled = Debounce
		
		Conffeti:Update()
		
	end
	
end)

function _Confetti.fire()
	
	spawn(function()
		
		Debounce = true
		
		wait(tick)
		
		Debounce = false
		
	end)
	
end

return _Confetti;
