I am currently trying to make it so when you click E, white appears and then disappears slowly. It isn't doing that
local uis = game:GetService("UserInputService")
local char = script.Parent
local equipRE = game.ReplicatedStorage:WaitForChild("NVGsToggled")
local defaultAmbient = game.Lighting.OutdoorAmbient
function Ball(input, processed)
uis.InputBegan:Connect(function(input, processed)
if processed then return end
if input.KeyCode == Enum.KeyCode.E then
if not char:FindFirstChild("NVGs") then
equipRE:FireServer(true)
game.Lighting.OutdoorAmbient = Color3.fromRGB(74, 74, 74)
game.Lighting.ColorCorrection.Enabled = true
local uis = game:GetService("UserInputService")
local char = script.Parent
local equipRE = game.ReplicatedStorage:WaitForChild("NVGsToggled")
local defaultAmbient = game.Lighting.OutdoorAmbient
uis.InputBegan:Connect(function(input, processed)
if processed then return end
if input.KeyCode == Enum.KeyCode.E then
if not char:FindFirstChild("NVGs") then
equipRE:FireServer(true)
game.Lighting.OutdoorAmbient = Color3.fromRGB(0, 0, 0)
game.Lighting.ColorCorrection.Enabled = true
for i = 1, 0, 0.1 do
wait(0.01)
game.StarterGui.ScreenGui.Frame.BackgroundTransparency = i
end
wait(0.05)
for i = 0, 1, 0.1 do
wait(0.1)
game.StarterGui.ScreenGui.Frame.BackgroundTransparency = i
end
else
equipRE:FireServer(false)
game.Lighting.OutdoorAmbient = defaultAmbient
game.Lighting.ColorCorrection.Enabled = false
end
end
end)
else
equipRE:FireServer(false)
game.Lighting.OutdoorAmbient = defaultAmbient
game.Lighting.ColorCorrection.Enabled = false
end
end
end)
end
uis.InputBegan:Connect(Ball)
Ive tried basically anything
