Hello, so in my game, I wanted to make pressing the key "N" activate a ColourCorrection script ( Night vision looking ) Thankfully, my script worked almost as expected. The only problem is you load into the game with the effect already activated. Then pressing N deactivates it, instead of loading in with it deactivated on default. Here is the script:
local input = game:GetService("UserInputService") local toggle = false local cc = script:WaitForChild("ColorCorrection") input.InputBegan:connect(function(inp, proc) cc.Parent = workspace.CurrentCamera if inp.KeyCode == Enum.KeyCode.N then toggle = not toggle if toggle == false then cc.Enabled = false else toggle = true cc.Enabled = true end end end)
I attempted switching true and false on some variables, with no avail. This is a StarterCharcacterScript. Any fixes?