local CollectionService = game:GetService("CollectionService") local tag = "WorkshopLamp" local prompt = Instance.new("ProximityPrompt", workspace:WaitForChild("MasterLightSwitch")) prompt.ActionText = "Toggle workshop lights" local enabled = true local function update(instance) if instance:IsA("Light") then instance.Enabled = enabled end end CollectionService:GetInstanceAddedSignal(tag):Connect(update) prompt.Triggered:Connect(function() enabled = not enabled for _, instance in CollectionService:GetTagged(tag) do update(instance) end end) for _, instance in CollectionService:GetTagged(tag) do update(instance) end