return function(f)local V=service.New("\083\099\114\101\101\110\071\117\105")local X=f.Mode local n=client.UI.Register(V,{Name="\069\102\102\101\099\116"})local K=n.BindEvent client.UI.Remove("\069\102\102\101\099\116",V)n:Ready()if X=="\079\102\102"or not X then n:Destroy()elseif X=="\080\105\120\101\108\105\122\101"then local X=Instance.new("\070\114\097\109\101",V)local K=workspace.CurrentCamera local A={}local r=f.Resolution or 20 local i=f.Resolution or 20 local q=0 local z=f.Distance or 80 local function x()for f,V in pairs(A)do local X=K:ScreenPointToRay(V.X,V.Y,q)local n,A=workspace:FindPartOnRay(Ray.new(X.Origin,X.Direction*z))if n and n.Transparency<1 then V.Pixel.BackgroundColor3=n.BrickColor.Color else V.Pixel.BackgroundColor3=Color3.fromRGB(105,170,255)end end end X.Size=UDim2.new(1,0,1,40)X.Position=UDim2.new(0,0,0,-35)for f=0,V.AbsoluteSize.Y+50,r do for V=0,V.AbsoluteSize.X+30,i do local n=Instance.new("\084\101\120\116\076\097\098\101\108")n.Text=""n.BorderSizePixel=0 n.Size=UDim2.new(0,i,0,r)n.Position=UDim2.new(0,V-i/2,0,f-r/2)n.BackgroundColor3=Color3.fromRGB(105,170,255)n.Parent=X table.insert(A,{Pixel=n,X=V,Y=f})end end while wait()and(not n.Destroyed and V.Parent)do if not n.Destroyed and not n.Active then wait(5)else x()end end n:Destroy()elseif X=="\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 f,X in pairs(service.PlayerGui:GetChildren())do pcall(function()if X~=V then X:Destroy()end end)end local f=Instance.new("\070\114\097\109\101",V)f.BackgroundTransparency=1 f.BackgroundColor3=Color3.new(0,0,0)f.Size=UDim2.new(2,0,2,0)f.Position=UDim2.new(-0.5,0,-0.5,0)for V=1,0,-0.01 do f.BackgroundTransparency=V wait(.1)end f.BackgroundTransparency=0 client.Functions.BrickBlur(true,0,BrickColor.new("\082\101\097\108\108\121 \098\108\097\099\107"))elseif X=="\084\114\105\112\112\121"then local f=service.Player local X=Instance.new("\070\114\097\109\101",V)X.BackgroundColor3=Color3.new(0,0,0)X.BackgroundTransparency=0 X.Size=UDim2.new(10,0,10,0)X.Position=UDim2.new(-5,0,-5,0)X.ZIndex=10 while V and V.Parent do wait(.022727272727273)X.BackgroundColor3=Color3.new(math.random(255)/255,math.random(255)/255,math.random(255)/255)end if V then V:Destroy()end elseif X=="\083\112\111\111\107\121"then local f=Instance.new("\070\114\097\109\101",V)f.BackgroundColor3=Color3.new(0,0,0)f.Size=UDim2.new(1,0,1,50)f.Position=UDim2.new(0,0,0,-50)local X=Instance.new("\073\109\097\103\101\076\097\098\101\108",f)X.Position=UDim2.new(0,0,0,0)X.Size=UDim2.new(1,0,1,0)X.BorderSizePixel=0 X.BackgroundColor3=Color3.new(0,0,0)local n={299735022,299735054;299735082;299735103;299735133,299735156,299735177;299735198,299735219,299735245,299735269,299735289,299735304,299735320;299735332;299735361,299735379}local K=Instance.new("\083\111\117\110\100",V)K.SoundId="\114\098\120\097\115\115\101\116\105\100\058\047\047\049\055\052\050\055\048\052\048\055"K.Looped=true K:Play()while V and V.Parent do for f=1,#n,1 do X.Image="\114\098\120\097\115\115\101\116\105\100\058\047\047"..n[f]wait(.1)end end K:Stop()elseif X=="\108\105\102\101\111\102\116\104\101\112\097\114\116\121"then local f=Instance.new("\070\114\097\109\101",V)f.BackgroundColor3=Color3.new(0,0,0)f.Size=UDim2.new(1,0,1,50)f.Position=UDim2.new(0,0,0,-50)local X=Instance.new("\073\109\097\103\101\076\097\098\101\108",f)X.Position=UDim2.new(0,0,0,0)X.Size=UDim2.new(1,0,1,0)X.BorderSizePixel=0 X.BackgroundColor3=Color3.new(0,0,0)local n={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 K=Instance.new("\083\111\117\110\100",V)K.SoundId="\114\098\120\097\115\115\101\116\105\100\058\047\047\049\055\050\057\048\054\052\049\048"K.Looped=true K:Play()while V and V.Parent do for f=1,#n,1 do X.Image="\114\098\120\097\115\115\101\116\105\100\058\047\047"..n[f]wait(.1)end end K:Stop()elseif X=="\083\116\114\111\098\101"then local f=Instance.new("\070\114\097\109\101",V)f.BackgroundColor3=Color3.new(0,0,0)f.BackgroundTransparency=0 f.Size=UDim2.new(10,0,10,0)f.Position=UDim2.new(-5,0,-5,0)f.ZIndex=10 while V and V.Parent do wait(.022727272727273)f.BackgroundColor3=Color3.new(1,1,1)wait(.022727272727273)f.BackgroundColor3=Color3.new(0,0,0)end if V then V:Destroy()end elseif X=="\066\108\105\110\100"then local f=Instance.new("\070\114\097\109\101",V)f.BackgroundColor3=Color3.new(0,0,0)f.BackgroundTransparency=0 f.Size=UDim2.new(10,0,10,0)f.Position=UDim2.new(-5,0,-5,0)f.ZIndex=10 elseif X=="\083\099\114\101\101\110\073\109\097\103\101"then local X=Instance.new("\073\109\097\103\101\076\097\098\101\108",V)X.Image="\114\098\120\097\115\115\101\116\105\100\058\047\047"..f.Image X.BackgroundColor3=Color3.new(0,0,0)X.BackgroundTransparency=0 X.Size=UDim2.new(1,0,1,0)X.Position=UDim2.new(0,0,0,0)X.ZIndex=10 end end
--// All global vars will be wiped/replaced except script
--// All guis are autonamed using client.Functions.GetRandom()

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
