Here is my code so you guys can take a look at, I imagine it's not hard to fix but I still needed some more eyes!

local Player = game:GetService('Players').LocalPlayer
local UIS = game:GetService('UserInputService')
local Person = false


UIS.InputBegan:Connect(function(input,Word)
	if Word ~= "None" then
	if input.KeyCode == Enum.KeyCode.T then
			for i,v in pairs(game:GetService('Players'):GetChildren()) do
				if string.find(string.lower(Word),string.lower(v.Name)) then
					Person = true
					spawn(function()
						local Effect = Instance.new("ColorCorrectionEffect",game:GetService('Lighting'))
						Effect.Name = "DivinationEffect"
							
					for i = 0,-1,-.1 do
						Effect.Brightness = i
						wait()
					end
						
					Effect.Saturation = -1
					game:GetService('Workspace').CurrentCamera.CameraSubject = v.PrimaryPart.Parent:FindFirstChild('Humanoid')
					
					for i = -1,0,.1 do
						Effect.Brightness = i
						wait()
					end
					
					wait(4)
					
					for i = 0,-1,-.1 do
						Effect.Brightness = i
						wait()
					end	
						
					Effect.Saturation = 0
					game:GetService('Workspace').CurrentCamera.CameraSubject = Player.Character:FindFirstChild('Humanoid')
						
					for i = -1,0,.1 do
						Effect.Brightness = i
						wait()
					end
	
					Effect:Destroy()	
						
					end)
			
				end	
			end
		end
	end
end)

2 comments

0

Any error messages?

0

Nope.