Im basically trying to make a night vision script that sets the lighting to something and it works. but im trying to make a script in which if i click again that turns off, i tried to make that but the script here doesn’t work. Why?
local lighting = game:GetService("Lighting")
local key = game:GetService("UserInputService")
key.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.N then
lighting.Brightness = 5
lighting.ColorCorrection.Contrast = 1
else
lighting.Brightness = 0
lighting.ColorCorrection.Contrast = 0
end
end)
local lighting = game:GetService("Lighting")
local key = game:GetService("UserInputService")
key.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.N then
local b, c = 5, 1
if lighting.Brightness >= 4.9 and lighting.ColorCorrection.Contrast >= 0.9 then
b = 0
c = 0
end
lighting.Brightness = b
lighting.ColorCorrection.Contrast = c
end
end)
local lighting = game:GetService("Lighting")
local key = game:GetService("UserInputService")
key.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.N then
local b, c = 5, 1
if lighting.Brightness > 0 then
print("Bright")
b = 0
end
if lighting.ColorCorrection.Contrast >= 0 then
print("Contrast")
c = 0
end
lighting.Brightness = b
lighting.ColorCorrection.Contrast = c
end
end)