Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This is main part of switch Lights script so you use many ways to call it like function, while true do, click detector, proximity prompt, etc.
- local lightFolder = workspace.Lights
- local lights = lightFolder:GetChildren() -- Get Lights in Folder
- for i_, lightBulb in ipairs(lights) do
- local spotLight = lightBulb:FindFirstChildWhichIsA("SpotLight") -- To get all spotLight in each Lights
- if spotLight and not spotLight.Enabled then -- Check if SpotLight is not enabled
- spotLight.Enabled = true
- lightBulb.Material = Enum.Material.Neon
- elseif spotLight and spotLight.Enabled then -- Check if SpotLight is enabled
- spotLight.Enabled = false
- lightBulb.Material = Enum.Material.Glass
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement