I want to make it so that when i click a light switch the light should toggle
objects : Light > PointLight
Second Object : LightSwitch(Model) > ClickDetector > LightControllerScript , BoolLight(BoolValue)
Parent Object : StartingArea(Model, Is a room)
LightControllerScript :
script.Parent.MouseClick:Connect(function() if script.Parent.BoolLight.Value == true then workspace.StartingArea.Light.PointLight.Brightness = 0 workspace.StartingArea.Light.Material = 'Glass' script.Parent.BoolLight.Value = false end if script.Parent.BoolLight.Value == true then workspace.StartingArea.Light.PointLight.Brightness = 1 workspace.StartingArea.Light.Material = 'Neon' script.Parent.BoolLight.Value = false end print('Light has been triggered') end)
Console : Light has been triggered
And yet Nothing happened to the light it still remains on and never changes