I want to click in a part and whean I click it, I want another part to light. I'm kinda noob with scripting so can someone help me?
✓ ANSWER ACCEPTED
How to make a lightswitch?
1 answer
✓ Accepted answer
Put a ClickDetector inside of the Part and this script as a descendant of the Part as well. Make sure it's a PointLight. If not, I'm sure you can modify this.
on = false
script.Parent.ClickDetector.MouseClick:connect(function()
if on == false then
on = true
script.Parent.PointLight.Enabled = true
else
on = false
script.Parent.PointLight.Enabled = false
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Thank you very much, I didn't wanted to click in the light to turn it on and off, I wanted to click in an interrupter so it can turn the light on and off, but I changed some things in the script you send and it works :D Thanks a lot!
Glad I could help