function GUIParticles.New(s,U)local p=not pcall(function()local U=s.Parent end)if p then local U=Instance.new("\083\099\114\101\101\110\071\117\105")U.Parent=_L.Player.Get("\080\108\097\121\101\114\071\117\105")local p=Instance.new("\070\114\097\109\101")p.BackgroundTransparency=1 p.Size=UDim2.new(0,1,0,1)p.Position=s p.AnchorPoint=Vector2.new(.5,.5)p.Parent=U s=p end if particleFolder==nil then particleFolder=Instance.new("\070\111\108\100\101\114")particleFolder.Name="\071\085\073 \080\097\114\116\105\099\108\101\115"particleFolder.Parent=game.Workspace.CurrentCamera end local c=Instance.new("\080\097\114\116")c.Transparency=1 c.Material=Enum.Material.SmoothPlastic c.CanCollide=false c.Anchored=true c.Size=Vector3.new(0,0,0)c.Name=U.Name c.Parent=particleFolder local B=Instance.new("\065\116\116\097\099\104\109\101\110\116")B.Parent=c U=U:Clone()U.ZOffset=U.ZOffset+displayZ*.645 U.Parent=B local function q()local U=game.Workspace.CurrentCamera local p=U.ViewportSize local B,q=s.AbsoluteSize.X,s.AbsoluteSize.Y local f,o=s.AbsolutePosition.X+B/2,s.AbsolutePosition.Y+q/2 local x=(U:ScreenPointToRay(f,o,displayZ)).Origin c.CFrame=CFrame.new(x)*CFrame.Angles(U.CFrame:toEulerAnglesXYZ())end;(coroutine.wrap(function()while s and(particleFolder and(U and(c and U.Parent)))do q()_L.Services.RunService.RenderStepped:wait()end if s.Parent and p then s.Parent:Destroy()end if U then U:Destroy()end if c then c:Destroy()end end))()return U end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

function GUIParticles.New(gui, particle)
	--- Check if gui argument is a GUI instance or UDIM2 position
	local isGeneratedGui = not pcall(function()
		local x = gui.Parent
	end)

	--- Generate GUI holder if it is a UDIM2 position
	if isGeneratedGui then
		local fakeGuiHolder = Instance.new("ScreenGui")
		fakeGuiHolder.Parent = _L.Player.Get("PlayerGui")
		local fakeGui = Instance.new("Frame")
		fakeGui.BackgroundTransparency = 1
		fakeGui.Size = UDim2.new(0, 1, 0, 1)
		fakeGui.Position = gui
		fakeGui.AnchorPoint = Vector2.new(0.5, 0.5)
		fakeGui.Parent = fakeGuiHolder
		gui = fakeGui
	end

	--- Setup particle folder if it doesn't already exist
	if particleFolder == nil then
		particleFolder = Instance.new("Folder")
		particleFolder.Name = "GUI Particles"
		particleFolder.Parent = game.Workspace.CurrentCamera
	end

	--- Create particle's part holder
	local particlePart = Instance.new("Part")
	particlePart.Transparency = 1
	particlePart.Material = Enum.Material.SmoothPlastic
	particlePart.CanCollide = false
	particlePart.Anchored = true
	particlePart.Size = Vector3.new(0, 0, 0)
	particlePart.Name = particle.Name
	particlePart.Parent = particleFolder

	--- Create attachment for particles (avoid spread)
	local attachment = Instance.new("Attachment")
	attachment.Parent = particlePart

	--- Add in particles
	particle = particle:Clone()
	particle.ZOffset = particle.ZOffset + displayZ * 0.645 --- Hack of the century
	particle.Parent = attachment

	--- Math
	local function Update()
		local camera = game.Workspace.CurrentCamera
		local cameraSize = camera.ViewportSize
		local sizeX, sizeY = gui.AbsoluteSize.X, gui.AbsoluteSize.Y
		local posX, posY = gui.AbsolutePosition.X + (sizeX / 2), gui.AbsolutePosition.Y + (sizeY / 2)
		--[[local sizeInStudsTop = camera:ScreenPointToRay(gui.AbsolutePosition.X, gui.AbsolutePosition.Y, displayZ).Origin
		local sizeInStudsBottom = camera:ScreenPointToRay(gui.AbsolutePosition.X+sizeX, gui.AbsolutePosition.Y+sizeY, displayZ).Origin
		particlePart.Size = Vector3.new(math.abs(sizeInStudsBottom.X-sizeInStudsTop.X), math.abs(sizeInStudsBottom.Y-sizeInStudsTop.Y), 0.05) ]]
		local positionInStuds = camera:ScreenPointToRay(posX, posY, displayZ).Origin
		particlePart.CFrame = CFrame.new(positionInStuds) * CFrame.Angles(camera.CFrame:toEulerAnglesXYZ())
	end

	--- Main
	coroutine.wrap(function()
		--- Update
		while gui and particleFolder and particle and particlePart and particle.Parent do
			Update()
			_L.Services.RunService.RenderStepped:wait()
		end

		--- Destroy
		if gui.Parent and isGeneratedGui then
			gui.Parent:Destroy()
		end
		if particle then
			particle:Destroy()
		end
		if particlePart then
			particlePart:Destroy()
		end
	end)()

	--
	return particle
end
