deshea9
|
  |
| Joined: 07 Jan 2011 |
| Total Posts: 276 |
|
|
| 21 Oct 2017 05:57 PM |
The script will make the light turn on, but it will not do what is after the "else" ==========================
script.Parent.ClickDetector.MouseClick:connect(function() if light1.Enabled == false then light1.Enabled = true if light2.Enabled == false then light2.Enabled = true if light3.Enabled == false then light3.Enabled = true if light4.Enabled == false then light4.Enabled = true light1On.BrickColor = BrickColor.new("Earth green") lightsound:Play() else if light1.Enabled == true then light1.Enabled = false if light2.Enabled == true then light2.Enabled = false if light3.Enabled == true then light3.Enabled = false if light4.Enabled == true then light4.Enabled = false light1On.BrickColor = BrickColor.new("Really red") lightsound:Play() end end end end end end end end end) |
|
|
| Report Abuse |
|
|
deshea9
|
  |
| Joined: 07 Jan 2011 |
| Total Posts: 276 |
|
| |
|
deshea9
|
  |
| Joined: 07 Jan 2011 |
| Total Posts: 276 |
|
| |
|
|
| 21 Oct 2017 09:42 PM |
| don't just post a wall of code and expect us to solve it for you |
|
|
| Report Abuse |
|
|
deshea9
|
  |
| Joined: 07 Jan 2011 |
| Total Posts: 276 |
|
|
| 21 Oct 2017 09:46 PM |
| I don't expect you to solve it for me... just to give me some advice (ex: instead of "else" try doing this command ...) |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2017 09:46 PM |
| Uh... what exactly do you want the script to do? |
|
|
| Report Abuse |
|
|
WildGuest
|
  |
| Joined: 28 Feb 2010 |
| Total Posts: 647 |
|
|
| 21 Oct 2017 09:48 PM |
This is most of it except the colors may be off
script.Parent.ClickDetector.MouseClick:connect(function() if light1.Enabled == false then light1.Enabled = true elseif light1.Enabled == true then light1.Enabled = false end
if light2.Enabled == false then light2.Enabled = true elseif light2.Enabled == true then light2.Enabled = false end if light3.Enabled == false then light3.Enabled = true elseif light3.Enabled == true then light3.Enabled = false end if light4.Enabled == false then light4.Enabled = true elseif light4.Enabled == true then light4.Enabled = false end if light1.Enabled == false then light1On.BrickColor = BrickColor.new("Earth green") lightsound:Play() elseif light1.Enabled == true then light1On.BrickColor = BrickColor.new("Really red") lightsound:Play() end end)
|
|
|
| Report Abuse |
|
|
deshea9
|
  |
| Joined: 07 Jan 2011 |
| Total Posts: 276 |
|
|
| 21 Oct 2017 09:48 PM |
| It's a lighting system, when you click a button it will enable all the lights... But it just doesn't do what is after the else, (which is lights off) |
|
|
| Report Abuse |
|
|
deshea9
|
  |
| Joined: 07 Jan 2011 |
| Total Posts: 276 |
|
|
| 21 Oct 2017 09:49 PM |
| @wild Thanks man! I didn't realize I would use "ElseIf" |
|
|
| Report Abuse |
|
|