Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I toggle local lighting with a gui?

Asked by 5 years ago

Hey, I was wondering how I'd make a gui that would toggle local lighting (ColorCorrection) on and off (e.g. a greyscale effect that can be turned on and off via gui). Something similar to the script below? Any help would be great! :)

local lighting = game:GetService("Lighting")

script.Parent.MouseButton1Click:Connect(function()
    lighting.ColorCorrection.TintColor = Color3.fromRGB(255,255,255)
end

1 answer

Log in to vote
0
Answered by 5 years ago

ColorCorrection extends from PostEffect and PostEffect has a property called Enabled. You can simply toggle that on and off using:

lighting.ColorCorrection.Enabled = not lighting.ColorCorrection.Enabled
Ad

Answer this question