-- play particles + w/ custom 

function module.Play(data)
	local particle = data.particle or nil
	local part = data.part or nil
	local tim = data.tim or 1
	local beam = data.beam or nil
	
	
	if part ~= nil then
		coroutine.wrap(function()
			for i , v in pairs(part:GetDescendants()) do
				-- beams?
				if beam ~= nil then
					if v:IsA("Beam") then

						v.Enabled = true
						task.delay(tim, function()
							v.Enabled = false
						end)
					end
				end

				-- particle?
				if v:IsA("ParticleEmitter") then
					v.Enabled = false
					if v:GetAttribute("EmitCount") then
						v:Emit(v:GetAttribute("EmitCount"))
					end
					v.Enabled = true
					task.delay(tim, function()
						v.Enabled = false
						--game.Debris:AddItem(v, tim+1)
					end)
				end
			end
		end)()
		
	else
		if particle ~= nil then
			particle.Enabled = true
			task.delay(tim, function()
				particle.Enabled = false
				--game.Debris:AddItem(v, tim+1)
			end)
		end
	end
	
	local tab = {}
	tab.Part = particle
	tab.Beam = beam
	tab.particle = particle
	
	return tab
end

return module
