RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"light switch system"
-- local script local isOn = true function on() isOn = true script.Parent.Parent.Light.PointLight.Enabled = true script.LightSwitchOn:Play() end function off() isOn = false script.Parent.Parent.Light.PointLight.Enabled = false script.LightSwitchOff:Play() end function onClicked() if isOn == true then off() else on() end end script.Parent.ClickDetector.MouseClick:connect(onClicked) on()