local UIS = game:GetService('UserInputService')
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Color = game:GetService('Lighting')
UIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.C then
Color = (Instance.new("ColorCorrectionEffect"))
Color.Name = "BlackAndWhite"
Color.Brightness = 0
Color.Contrast = 0
Color.Enabled = true
Color.Saturation = -1
Color.TintColor = Color3.fromRGB(255,255,255)
Color.Parent = game.Lighting
local Anim = Instance.new('Animation')
Anim.AnimationId = 'rbxassetid://YourOwnID'
PlayAnim = Character.Humanoid:LoadAnimation(Anim)
PlayAnim:Play()
end
end)
UIS.InputEnded:connect(function(input)
wait(10)--- what i tried but i didnt work
if Color then
Color:Destroy()
end
PlayAnim:Stop()
end
end)
since im not very skilled at coding idk how to make it so it disapears after 10 seconds so i tried sum but it didnt work

2 comments
Remove() is deprecated. You should use Destroy() instead
fixed it