Hi,
I want to make a button that does two jobs. I press is once and it turns on the light, I press it again and it turns it off.
I have a blank script in the button with a click detector in the button as well.
This is the link from the script to the light
script.Parent.Parent.SpotLight1.Light.SpotLight
What would the script be so I can turn it on and off with the one button!?
Thanks Kieran
easy... say this is the Light Model;
Light Model<
LightModel<< -LightPart --PointLight
ButtonModel<< -Button --ClickDetector -Script
LP = script.Parent.Parent.LightModel.LightPart.PointLight btn = script.Parent.Button.ClickDetector function onClick() if LP.Enabled == true then LP.Enabled = false else LP.Enabled = true btn.MouseClick:connect(onClick)
LP = script.Parent.Parent.SpotLight1.Light.PointLight btn = script.Parent.ClickDetector function onClick() if LP.Enabled == true then LP.Enabled = false else LP.Enabled = true btn.MouseClick1:connect(onClick) end end