I am trying to make a First class seat for my airline. The lighting will not work. Here are the scripts.
(To make it off)
function onClicked()
script.Parent.Parent.Brightness = 0
script.Parent.Parent.Range = 0
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
(To make it on)
function onClicked()
script.Parent.Parent.Brightness = 1
script.Parent.Parent.Range = 8
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
You have to set a debounce. (go here for a further explanation: http://wiki.roblox.com/?title=Debounce)
I apologize, I should have fixed that. Set the script's parent to the Part instead of PointLight, because ClickDetector is not a child of PointLight.
debounce = false script.Parent.ClickDetector.MouseClick:connect(function() if debounce == false then script.Parent.PointLight.Brightness = 1 script.Parent.PointLight.Range = 8 debounce = true else script.Parent.PointLight.Brightness = 0 script.Parent.PointLight.Range = 0 debounce = false end end)