Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game.ReplicatedStorage.LightStatus.Sector1.Changed:Connect(function()
- for i, light in pairs(workspace:GetDescendants()) do
- if light.Name == "FacilityLight1" then
- wait()
- light.SpotLight.Enabled = game.ReplicatedStorage.LightStatus.Sector1.Value
- script.sfx:Clone().Parent = light
- light.sfx:Play()
- if light.SpotLight.Enabled == false then
- light.Material = "Glass"
- else
- light.Material = "Neon"
- end
- end
- end
- end)
- game.ReplicatedStorage.LightStatus.Sector2.Changed:Connect(function()
- for i, light in pairs(workspace:GetDescendants()) do
- if light.Name == "FacilityLight2" then
- wait()
- light.SpotLight.Enabled = game.ReplicatedStorage.LightStatus.Sector2.Value
- script.sfx:Clone().Parent = light
- light.sfx:Play()
- if light.SpotLight.Enabled == false then
- light.Material = "Glass"
- else
- light.Material = "Neon"
- end
- elseif light.Name == "Light_C_Q1" then
- wait()
- light.Bulb.SpotLight.Enabled = game.ReplicatedStorage.LightStatus.Sector2.Value
- script.sfx:Clone().Parent = light.Bulb
- light.Bulb.sfx:Play()
- if light.Bulb.SpotLight.Enabled == false then
- light.Bulb.Material = "Glass"
- else
- light.Bulb.Material = "Neon"
- end
- end
- end
- end)
- game.ReplicatedStorage.LightStatus.Sector3.Changed:Connect(function()
- for i, light in pairs(workspace:GetDescendants()) do
- if light.Name == "FacilityLight3" then
- wait()
- light.SpotLight.Enabled = game.ReplicatedStorage.LightStatus.Sector3.Value
- script.sfx:Clone().Parent = light
- light.sfx:Play()
- if light.SpotLight.Enabled == false then
- light.Material = "Glass"
- else
- light.Material = "Neon"
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement