0 views0 copies0 likes
Surface Switch for a Bank of Lights
Universal script
Copy it, then test it in your own Studio place.
Script code
13 lines ยท 0.5 KBlocal bank = workspace:WaitForChild("DisplayLights")local button = workspace:WaitForChild("LightSwitch")local prompt = Instance.new("ProximityPrompt", button)local enabled = truelocal function update() for _, light in bank:GetDescendants() do if light:IsA("Light") then light.Enabled = enabled end end button.Color = enabled and Color3.fromRGB(73, 230, 165) or Color3.fromRGB(240, 111, 76) prompt.ActionText = enabled and "Turn off" or "Turn on"endprompt.Triggered:Connect(function() enabled = not enabled; update() end)update()About this script
Put lights under Workspace.DisplayLights and add a part named LightSwitch. The script creates a prompt that toggles every light in the folder and updates the switch color to show its state. Each interaction changes the whole bank so individual lamps stay consistent. Try adding PointLights and SurfaceLights, then check whether the switch remains visible when the room goes dark.
Log in to leave a comment.
No comments yet
Be the first to share your thoughts!
Comments
Share what works, ask questions, or report an issue.