Hello everyone. I have a script t activate multiple emergency lights upon pressing a button. The problem is that only one turns on. It toggles the on and off, which I was surprised I could write in one try, but the other several lights (more will exist in the future) are not doing anything. Here is the directory:
[SCRIPT]>>Button>>Controls>>EmergencyLights<<Emergency Light(MULTIPLE)
Here is the script:
function onClicked() if script.Parent.Parent.Parent.EmergencyLight.Toggle.Value == true then script.Parent.Parent.Parent.EmergencyLight.Toggle.Value = false else script.Parent.Parent.Parent.EmergencyLight.Toggle.Value = true end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
The script has three parents, the first is the part(button), the second is controls(Group of parts that make up a panel that controls other stuff), and the third is the main group, which contains the lights and controls. The object called "Toggle" is a true/false value that decides whether the light(s) is on. If anyone knows how to tell my script to toggle all of the lights please tell me!
- PJB

3 comments
I really wish that this website recognized the line breaks...
It does. Use code blocks. Edit your post to use a code block.
If you want breaks between other text, use a double line break in the text area. This is standard markdown format.