I want the script to invert colors whenever i press Q, and i want it to revert to normal when i press it again
Theres no issue with the script itself i just dont know how to go about it and i’d like some help. I started scripting not too long ago and i cant seem to figure it out
Ive tried using Boolean values, like how people script opening and closing doors on click, but it didnt work
local UIS = game:GetService("UserInputService")
local lighting = game.Lighting
local bool = false
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q then
bool = true
repeat
wait(1)
lighting.ColorCorrection.Saturation = -3
print("Inverted Colors!")
until bool == false
end
end)
UIS.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q then
wait(1)
lighting.ColorCorrection.Saturation = 0
print("Normal Colors")
bool = false
end
end)
If its possible and someone has the answer please go into detail about how exactly is it done. Im still learning about scripting and i’d like an explanation i learn from
Thank you for your time