function _Confetti.Update(r,G)if r.Enabled and r.OutOfBounds then r.Position=Vector2.new(0,0)r.Power=Vector2.new((r.EmitterPower.X+math.random(10))-5,(r.EmitterPower.Y+math.random(10))-5)r.Cycles=r.Cycles+1 end if not r.Enabled and r.OutOfBounds or not r.Enabled and r.Cycles==0 then r.Label.Visible=false r.OutOfBounds=true return else r.Label.Visible=true end local t,q,y=r.EmitterPosition,r.Position,r.Power local f=r.Label if f then local G=Vector2.new(q.X-y.X,q.Y-y.Y)local k=Vector2.new(y.X/1.09-gravity.X,y.Y/1.1-gravity.Y)local z=Camera.ViewportSize f.Position=UDim2.new(t.X,G.X,t.Y,G.Y)r.OutOfBounds=f.AbsolutePosition.X>z.X and gravity.X>0 or f.AbsolutePosition.Y>z.Y and gravity.Y>0 or f.AbsolutePosition.X<0 and gravity.X<0 or f.AbsolutePosition.Y<0 and gravity.Y<0 r.Position,r.Power=G,k if k.Y<0 then if r.Size<=0 then r.Side=1 end if r.Size>=r.DefaultSize then r.Side=-1 end r.Size=r.Size+r.Side*2 f.Size=UDim2.new(0,r.DefaultSize,0,r.Size)end end end

function _Confetti:Update(paramDeltaTime)
	if (self.Enabled and self.OutOfBounds) then
		--self.Label.ImageColor3 = self.Color;
		self.Position = Vector2.new(0,0);
		self.Power = Vector2.new(self.EmitterPower.X + math.random(10)-5, self.EmitterPower.Y + math.random(10)-5);
		self.Cycles = self.Cycles + 1;
	end;	
	if (
		(not(self.Enabled) and self.OutOfBounds) or
			(not(self.Enabled) and (self.Cycles == 0))) then
		self.Label.Visible = false;
		self.OutOfBounds = true;
		--self.Color = colors[math.random(#colors)];
		return;
	else
		self.Label.Visible = true;
	end;
	local startPosition, currentPosition, currentPower = self.EmitterPosition, self.Position, self.Power;
	local imageLabel = self.Label;
	-- Apply change.
	if (imageLabel) then
		-- Update position.
		local newPosition = Vector2.new(currentPosition.X - currentPower.X, currentPosition.Y - currentPower.Y);
		local newPower = Vector2.new((currentPower.X/1.09) - gravity.X, (currentPower.Y/1.1) - gravity.Y);
		local ViewportSize = Camera.ViewportSize;
		imageLabel.Position = UDim2.new(startPosition.X, newPosition.X, startPosition.Y, newPosition.Y);
		self.OutOfBounds = 
			(imageLabel.AbsolutePosition.X > ViewportSize.X and gravity.X > 0) or
			(imageLabel.AbsolutePosition.Y > ViewportSize.Y and gravity.Y > 0) or
			(imageLabel.AbsolutePosition.X < 0  and gravity.X < 0) or
			(imageLabel.AbsolutePosition.Y < 0 and gravity.Y < 0);
		self.Position, self.Power = newPosition, newPower;
		-- Start spinning if it's reached max height.
		if (newPower.Y < 0) then
			if (self.Size <= 0) then
				self.Side = 1;
				--imageLabel.ImageColor3 = self.Color;
			end;
			if (self.Size >= self.DefaultSize) then 
				self.Side = -1;
				--imageLabel.ImageColor3 = Color3.new(self.Color.r * 0.65, self.Color.g * 0.65, self.Color.b * 0.65);
			end;
			self.Size = self.Size + (self.Side * 2);
			imageLabel.Size = UDim2.new(0, self.DefaultSize, 0, self.Size);				
		end;
	end;
end;