(This has been solved thanks to Danny/14zanderblitz. Despite zander's answer being incorrect, it still helped me realize the correct way to do it. So i will still give him the kudos of having the right answer, but I will edit the code I posted to show what the right way was)
I am trying to make a light switch box, and when you click the switch, it will flip up, and stay there for 2 seconds before flipping back down, this is due to the fact I do not know how to make it work whenever the light switch stays in the upright position, but that's besides the point. I want to make a red light come on to indicate the power is on, and to add to it, I want to make the material of the light shine, hense the reason I want it to be neon, sorry if this doesn't exactly make sense. Here is my code:
light = script.Parent.Parent.Parent.LightBulbRed -- This is the light bulb
switch = script.Parent.Parent -- This is the switch
function onClick ()
if light.PointLight.Range == 0 then
light.PointLight.Range = 6
else
wait(2)
light.PointLight.Range = 0 -- How bright you want it
end
end
function material ()
if light.Material == Enum.Material.SmoothPlastic then
light.Material = Enum.Material.Neon
else
wait (2)
light.Material = Enum.Material.SmoothPlastic
end
end
script.Parent.MouseClick:Connect(onClick)
script.Parent.MouseClick:Connect(material)
Thank you Danny and Zander

2 comments
Material is an enum value
Thank you for accepting my answer, though I realized what I missed, I'll just change the answer to the correct way of doing things. Cheers!