--- Effect kind of like a flashbang (for when you need to surprise the user maybe?)



return function(addTime, decayTime, color, transparency)
	--- Variables
	addTime = addTime or 1
	decayTime = decayTime or 1
	color = color or Color3.new(1, 1, 1)
	transparency = transparency or 0
	--
	local animationStartTime = tick()
	
	--- Main
	coroutine.wrap(function()
		--- Create flash gui
		local flashGui = Instance.new("Frame")
		flashGui.BackgroundTransparency = 1
		flashGui.BackgroundColor3 = color
		flashGui.Size = UDim2.new(2, 0, 2, 0)
		flashGui.AnchorPoint = Vector2.new(0.5, 0.5)
		flashGui.Position = UDim2.new(0.5, 0, 0.5, 0)
		flashGui.BorderSizePixel = 0
		flashGui.Parent = _L.GUIFX.GetHolder()
		
		--- Flash!
		if addTime > 0 then
			_L.Functions.FastTween(flashGui, {BackgroundTransparency = transparency}, {addTime, "Linear", "Out"})
			wait(addTime)
		else
			flashGui.BackgroundTransparency = transparency
		end
		
		--- Fade away flash
		if decayTime > 0 then
			_L.Functions.FastTween(flashGui, {BackgroundTransparency = 1}, {decayTime, "Sine", "Out"})
			wait(decayTime)
		else
			flashGui.BackgroundTransparency = 1
		end
		
		--- Destroy flash
		flashGui:Destroy()
	end)()
end
