I am trying to make a light switch that can affect many lights and have a wait period of .5 seconds in between it, but the scripts that I try don't work. I've tried different names of the parts and having those inside the script, but it only effects one of the lights. So, here's the script that can actually do something to the light, but only to one.
Also, I am a noob at scripting, please go easy on me!
function onClicked(plyr)
v = script.Parent.Value
if v.Value == false then
v.Value = true
game:GetService("Workspace").Light.Material = Enum.Material.Neon
workspace.Light.BrickColor = BrickColor.new("Fossil")
script.Parent.BrickColor = BrickColor.new("Bright red")
workspace.Light.SurfaceLight.Enabled = true
elseif v.Value == true then
v.Value = false
game:GetService("Workspace").Light.Material = Enum.Material.Glass
workspace.Light.BrickColor = BrickColor.new("Black")
script.Parent.BrickColor = BrickColor.new("Bright red")
workspace.Light.SurfaceLight.Enabled = false
wait(1.05)
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

1 comment
OMG IT WORKS! Thanks so much!