return function(l)local d=service.New("\083\099\114\101\101\110\071\117\105")local Z=l.Mode local z=client.UI.Register(d,{Name="\069\102\102\101\099\116"})local w=z.BindEvent client.UI.Remove("\069\102\102\101\099\116",d)z:Ready()if Z=="\079\102\102"or not Z then z:Destroy()elseif Z=="\080\105\120\101\108\105\122\101"then local Z=Instance.new("\070\114\097\109\101",d)local w=workspace.CurrentCamera local J={}local n=l.Resolution or 20 local c=l.Resolution or 20 local f=0 local Q=l.Distance or 80 local function q()for l,d in pairs(J)do local Z=w:ScreenPointToRay(d.X,d.Y,f)local z,J=workspace:FindPartOnRay(Ray.new(Z.Origin,Z.Direction*Q))if z and z.Transparency<1 then d.Pixel.BackgroundColor3=z.BrickColor.Color else d.Pixel.BackgroundColor3=Color3.fromRGB(105,170,255)end end end Z.Size=UDim2.new(1,0,1,40)Z.Position=UDim2.new(0,0,0,-35)for l=0,d.AbsoluteSize.Y+50,n do for d=0,d.AbsoluteSize.X+30,c do local z=Instance.new("\084\101\120\116\076\097\098\101\108")z.Text=""z.BorderSizePixel=0 z.Size=UDim2.new(0,c,0,n)z.Position=UDim2.new(0,d-c/2,0,l-n/2)z.BackgroundColor3=Color3.fromRGB(105,170,255)z.Parent=Z table.insert(J,{Pixel=z,X=d;Y=l})end end while wait()and(not z.Destroyed and d.Parent)do if not z.Destroyed and not z.Active then wait(5)else q()end end z:Destroy()elseif Z=="\070\097\100\101\079\117\116"then service.StarterGui:SetCore("\084\111\112\098\097\114\069\110\097\098\108\101\100",false)service.UserInputService.MouseIconEnabled=false for l,Z in pairs(service.PlayerGui:GetChildren())do pcall(function()if Z~=d then Z:Destroy()end end)end local l=Instance.new("\070\114\097\109\101",d)l.BackgroundTransparency=1 l.BackgroundColor3=Color3.new(0,0,0)l.Size=UDim2.new(2,0,2,0)l.Position=UDim2.new(-0.5,0,-0.5,0)for d=1,0,-0.01 do l.BackgroundTransparency=d wait(.1)end l.BackgroundTransparency=0 client.Functions.BrickBlur(true,0,BrickColor.new("\082\101\097\108\108\121 \098\108\097\099\107"))elseif Z=="\084\114\105\112\112\121"then local l=service.Player local Z=Instance.new("\070\114\097\109\101",d)Z.BackgroundColor3=Color3.new(0,0,0)Z.BackgroundTransparency=0 Z.Size=UDim2.new(10,0,10,0)Z.Position=UDim2.new(-5,0,-5,0)Z.ZIndex=10 while d and d.Parent do wait(.022727272727273)Z.BackgroundColor3=Color3.new(math.random(255)/255,math.random(255)/255,math.random(255)/255)end if d then d:Destroy()end elseif Z=="\083\112\111\111\107\121"then local l=Instance.new("\070\114\097\109\101",d)l.BackgroundColor3=Color3.new(0,0,0)l.Size=UDim2.new(1,0,1,50)l.Position=UDim2.new(0,0,0,-50)local Z=Instance.new("\073\109\097\103\101\076\097\098\101\108",l)Z.Position=UDim2.new(0,0,0,0)Z.Size=UDim2.new(1,0,1,0)Z.BorderSizePixel=0 Z.BackgroundColor3=Color3.new(0,0,0)local z={299735022,299735054;299735082;299735103,299735133,299735156,299735177,299735198;299735219,299735245;299735269,299735289;299735304;299735320;299735332,299735361;299735379}local w=Instance.new("\083\111\117\110\100",d)w.SoundId="\114\098\120\097\115\115\101\116\105\100\058\047\047\049\055\052\050\055\048\052\048\055"w.Looped=true w:Play()while d and d.Parent do for l=1,#z,1 do Z.Image="\114\098\120\097\115\115\101\116\105\100\058\047\047"..z[l]wait(.1)end end w:Stop()elseif Z=="\108\105\102\101\111\102\116\104\101\112\097\114\116\121"then local l=Instance.new("\070\114\097\109\101",d)l.BackgroundColor3=Color3.new(0,0,0)l.Size=UDim2.new(1,0,1,50)l.Position=UDim2.new(0,0,0,-50)local Z=Instance.new("\073\109\097\103\101\076\097\098\101\108",l)Z.Position=UDim2.new(0,0,0,0)Z.Size=UDim2.new(1,0,1,0)Z.BorderSizePixel=0 Z.BackgroundColor3=Color3.new(0,0,0)local z={299733203,299733248,299733284;299733309;299733355,299733386,299733404,299733425;299733472;299733489;299733501;299733523,299733544,299733551;299733564;299733570;299733581,299733597;299733609,299733621,299733632;299733640,299733648;299733663;299733674,299733694}local w=Instance.new("\083\111\117\110\100",d)w.SoundId="\114\098\120\097\115\115\101\116\105\100\058\047\047\049\055\050\057\048\054\052\049\048"w.Looped=true w:Play()while d and d.Parent do for l=1,#z,1 do Z.Image="\114\098\120\097\115\115\101\116\105\100\058\047\047"..z[l]wait(.1)end end w:Stop()elseif Z=="\083\116\114\111\098\101"then local l=Instance.new("\070\114\097\109\101",d)l.BackgroundColor3=Color3.new(0,0,0)l.BackgroundTransparency=0 l.Size=UDim2.new(10,0,10,0)l.Position=UDim2.new(-5,0,-5,0)l.ZIndex=10 while d and d.Parent do wait(.022727272727273)l.BackgroundColor3=Color3.new(1,1,1)wait(.022727272727273)l.BackgroundColor3=Color3.new(0,0,0)end if d then d:Destroy()end elseif Z=="\066\108\105\110\100"then local l=Instance.new("\070\114\097\109\101",d)l.BackgroundColor3=Color3.new(0,0,0)l.BackgroundTransparency=0 l.Size=UDim2.new(10,0,10,0)l.Position=UDim2.new(-5,0,-5,0)l.ZIndex=10 elseif Z=="\083\099\114\101\101\110\073\109\097\103\101"then local Z=Instance.new("\073\109\097\103\101\076\097\098\101\108",d)Z.Image="\114\098\120\097\115\115\101\116\105\100\058\047\047"..l.Image Z.BackgroundColor3=Color3.new(0,0,0)Z.BackgroundTransparency=0 Z.Size=UDim2.new(1,0,1,0)Z.Position=UDim2.new(0,0,0,0)Z.ZIndex=10 end end


return function(data)
	local gui = service.New("ScreenGui")
	local mode = data.Mode
	local gTable = client.UI.Register(gui, {Name = "Effect"})
	local BindEvent = gTable.BindEvent
	
	client.UI.Remove("Effect", gui)
	gTable:Ready()
	
	if mode == "Off" or not mode then
		gTable:Destroy()
	elseif mode == "Pixelize" then
		local frame = Instance.new("Frame",gui)
		local camera = workspace.CurrentCamera
		local pixels = {}
		
		local resY = data.Resolution or 20
		local resX = data.Resolution or 20
		local depth = 0
		local distance = data.Distance or 80
		
		local function renderScreen()
			for i,pixel in pairs(pixels) do
				local ray = camera:ScreenPointToRay(pixel.X,pixel.Y,depth)
				local part, endPoint = workspace:FindPartOnRay(Ray.new(ray.Origin,ray.Direction*distance))
				if part and part.Transparency < 1 then
					pixel.Pixel.BackgroundColor3 = part.BrickColor.Color
				else
					pixel.Pixel.BackgroundColor3 = Color3.fromRGB(105, 170, 255)
				end
			end
		end
		
		frame.Size = UDim2.new(1,0,1,40)
		frame.Position = UDim2.new(0,0,0,-35)
		for y = 0,gui.AbsoluteSize.Y+50,resY do
			for x = 0,gui.AbsoluteSize.X+30,resX do
				local pixel = Instance.new("TextLabel")
				pixel.Text = ""
				pixel.BorderSizePixel = 0
				pixel.Size = UDim2.new(0,resX,0,resY)
				pixel.Position = UDim2.new(0,x-(resX/2),0,y-(resY/2))
				pixel.BackgroundColor3 = Color3.fromRGB(105, 170, 255)
				pixel.Parent = frame
				table.insert(pixels,{Pixel = pixel,X = x, Y = y})
			end
		end
		
		while wait() and not gTable.Destroyed and gui.Parent do 
			if not gTable.Destroyed and not gTable.Active then
				wait(5)
			else
				renderScreen()
			end
		end
		
		gTable:Destroy()
	elseif mode == "FadeOut" then
		service.StarterGui:SetCore("TopbarEnabled",false)
		service.UserInputService.MouseIconEnabled = false
		for i,v in pairs(service.PlayerGui:GetChildren()) do 
			pcall(function() if v~=gui then v:Destroy() end end) 
		end
		local bg = Instance.new("Frame", gui)
		bg.BackgroundTransparency = 1
		bg.BackgroundColor3 = Color3.new(0,0,0)
		bg.Size = UDim2.new(2,0,2,0)
		bg.Position = UDim2.new(-0.5,0,-0.5,0)
		for i = 1,0,-0.01 do
			bg.BackgroundTransparency = i
			wait(0.1)
		end
		bg.BackgroundTransparency = 0
		client.Functions.BrickBlur(true,0,BrickColor.new("Really black"))
	elseif mode == "Trippy" then
		local v = service.Player
		local bg = Instance.new("Frame", gui) 
		
		bg.BackgroundColor3 = Color3.new(0,0,0) 
		bg.BackgroundTransparency = 0 
		bg.Size = UDim2.new(10,0,10,0) 
		bg.Position = UDim2.new(-5,0,-5,0) 
		bg.ZIndex = 10
		
		while gui and gui.Parent do 
			wait(1/44) 
			bg.BackgroundColor3 = Color3.new(math.random(255)/255,math.random(255)/255,math.random(255)/255) 
		end
		
		if gui then gui:Destroy() end
	elseif mode == "Spooky" then
		local frame = Instance.new("Frame",gui)
		frame.BackgroundColor3=Color3.new(0,0,0)
		frame.Size=UDim2.new(1,0,1,50)
		frame.Position=UDim2.new(0,0,0,-50)
		local img = Instance.new("ImageLabel",frame)
		img.Position = UDim2.new(0,0,0,0)
		img.Size = UDim2.new(1,0,1,0)
		img.BorderSizePixel = 0
		img.BackgroundColor3 = Color3.new(0,0,0)
		local textures = {
			299735022;
			299735054;
			299735082;
			299735103;
			299735133;
			299735156;
			299735177;
			299735198;
			299735219;
			299735245;
			299735269;
			299735289;
			299735304;
			299735320;
			299735332;
			299735361;
			299735379;
		}
		
		local sound = Instance.new("Sound",gui)
		sound.SoundId = "rbxassetid://174270407"
		sound.Looped = true
		sound:Play()
		
		while gui and gui.Parent do
			for i=1,#textures do
				img.Image = "rbxassetid://"..textures[i]
				wait(0.1)
			end
		end
		sound:Stop()
	elseif mode == "lifeoftheparty" then
		local frame = Instance.new("Frame",gui)
		frame.BackgroundColor3 = Color3.new(0,0,0)
		frame.Size = UDim2.new(1,0,1,50)
		frame.Position = UDim2.new(0,0,0,-50)
		local img = Instance.new("ImageLabel",frame)
		img.Position = UDim2.new(0,0,0,0)
		img.Size = UDim2.new(1,0,1,0)
		img.BorderSizePixel = 0
		img.BackgroundColor3 = Color3.new(0,0,0)
		local textures = {
			299733203;
			299733248;
			299733284;
			299733309;
			299733355;
			299733386;
			299733404;
			299733425;
			299733472;
			299733489;
			299733501;
			299733523;
			299733544;
			299733551;
			299733564;
			299733570;
			299733581;
			299733597;
			299733609;
			299733621;
			299733632;
			299733640;
			299733648;
			299733663;
			299733674;
			299733694;
			
		}
		local sound = Instance.new("Sound",gui)
		sound.SoundId = "rbxassetid://172906410"
		sound.Looped = true
		sound:Play()
		
		while gui and gui.Parent do
			for i=1,#textures do
				img.Image = "rbxassetid://"..textures[i]
				wait(0.1)
			end
		end
		
		sound:Stop()
	elseif mode == "Strobe" then
		local bg = Instance.new("Frame", gui) 
		bg.BackgroundColor3 = Color3.new(0,0,0) 
		bg.BackgroundTransparency = 0 
		bg.Size = UDim2.new(10,0,10,0) 
		bg.Position = UDim2.new(-5,0,-5,0)
		bg.ZIndex = 10
		
		while gui and gui.Parent do
			wait(1/44) 
			bg.BackgroundColor3 = Color3.new(1,1,1) 
			wait(1/44) 
			bg.BackgroundColor3 = Color3.new(0,0,0) 
		end
		if gui then gui:Destroy() end
	elseif mode == "Blind" then
		local bg = Instance.new("Frame", gui) 
		bg.BackgroundColor3 = Color3.new(0,0,0) 
		bg.BackgroundTransparency = 0 
		bg.Size = UDim2.new(10,0,10,0) 
		bg.Position = UDim2.new(-5,0,-5,0) 
		bg.ZIndex = 10
	elseif mode == "ScreenImage" then
		local bg = Instance.new("ImageLabel", gui) 
		bg.Image="rbxassetid://"..data.Image
		bg.BackgroundColor3 = Color3.new(0,0,0) 
		bg.BackgroundTransparency = 0 
		bg.Size = UDim2.new(1,0,1,0) 
		bg.Position = UDim2.new(0,0,0,0) 
		bg.ZIndex = 10
	end
end
