Trying different options now for a while and I just can't find a way, so i'm going to ask here. I'm trying to create a button that when it's pressed (on a gui) lights flash every one second, for a plane. So when your sitting in a cockpit you press the lights button and on the wings lights start flashing. I'm a beginner scripter but this is what I've tried for the button, on a brick:
function onClicked() script.Parent.Parent.Light.Script.Disabled = true script.Parent.ClickDetector.MouseClick:connect(onClicked) end
and this is the loop on the light brick:
while true do script.Parent.PointLight.Enabled = true wait(1) script.Parent.PointLight.Enabled = false wait(1) end
Any help would be appreciated Thanks Light
You can't call a function from inside of itself. That's your only problem.
function onClicked() script.Parent.Parent.Light.Script.Disabled = true end script.Parent.ClickDetector.MouseClick:connect(onClicked)