|
| 30 Jul 2013 05:18 AM |
function onClicked() script.Parent.Parent.Part1.SpotLight.Enabled = true script.Parent.Parent.Part2.SpotLight.Enabled = true script.Parent.Parent.Part3.SpotLight.Enabled = true script.Parent.Parent.Part4.SpotLight.Enabled = true else script.Parent.Parent.Part1.SpotLight.Enabled = false script.Parent.Parent.Part2.SpotLight.Enabled = false script.Parent.Parent.Part3.SpotLight.Enabled = false script.Parent.Parent.Part4.SpotLight.Enabled = false end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
--The "else" was wriggled as red for an Error, but I don't know how to fix this error. |
|
|
| Report Abuse |
|
|
Gogeta
|
  |
| Joined: 25 Nov 2006 |
| Total Posts: 583 |
|
|
| 30 Jul 2013 05:23 AM |
Insert a String Value into the brick with the value labeled as Disabled. function onClicked() if script.Parent.StringValue.Value = "Disabled" script.Parent.StringValue.Value = "Enabled" script.Parent.Parent.Part1.SpotLight.Enabled = true script.Parent.Parent.Part2.SpotLight.Enabled = true script.Parent.Parent.Part3.SpotLight.Enabled = true script.Parent.Parent.Part4.SpotLight.Enabled = true else if script.Parent.StringValue.Value = "Enabled" script.Parent.StringValue.Value = "Disabled" script.Parent.Parent.Part1.SpotLight.Enabled = false script.Parent.Parent.Part2.SpotLight.Enabled = false script.Parent.Parent.Part3.SpotLight.Enabled = false script.Parent.Parent.Part4.SpotLight.Enabled = false end end end
script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
Gogeta
|
  |
| Joined: 25 Nov 2006 |
| Total Posts: 583 |
|
|
| 30 Jul 2013 05:24 AM |
I'm sorry it's this. function onClicked() if script.Parent.StringValue.Value = "Disabled" then script.Parent.StringValue.Value = "Enabled" script.Parent.Parent.Part1.SpotLight.Enabled = true script.Parent.Parent.Part2.SpotLight.Enabled = true script.Parent.Parent.Part3.SpotLight.Enabled = true script.Parent.Parent.Part4.SpotLight.Enabled = true else if script.Parent.StringValue.Value = "Enabled" then script.Parent.StringValue.Value = "Disabled" script.Parent.Parent.Part1.SpotLight.Enabled = false script.Parent.Parent.Part2.SpotLight.Enabled = false script.Parent.Parent.Part3.SpotLight.Enabled = false script.Parent.Parent.Part4.SpotLight.Enabled = false end end end
script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2013 05:27 AM |
| Do I have to add the Value into a part? |
|
|
| Report Abuse |
|
|
| |
|
Gogeta
|
  |
| Joined: 25 Nov 2006 |
| Total Posts: 583 |
|
| |
|
|
| 30 Jul 2013 05:39 AM |
ClassName = StringValue Name = Value Parent = Part1 Value = Disabled
Am I correct in this property? |
|
|
| Report Abuse |
|
|
Gogeta
|
  |
| Joined: 25 Nov 2006 |
| Total Posts: 583 |
|
|
| 30 Jul 2013 05:42 AM |
| Name should just be StringValue the value is correct. |
|
|
| Report Abuse |
|
|
Kondou
|
  |
| Joined: 05 Aug 2012 |
| Total Posts: 1148 |
|
|
| 30 Jul 2013 06:05 AM |
local spp = script.Parent.Parent function onClicked()
if spp.Part1.SpotLight.Enabled == false then spp.Part1.SpotLight.Enabled = true spp.Part2.SpotLight.Enabled = true spp.Part3.SpotLight.Enabled = true spp.Part4.SpotLight.Enabled = true else spp.Part1.SpotLight.Enabled = false spp.Part2.SpotLight.Enabled = false spp.Part3.SpotLight.Enabled = false spp.Part4.SpotLight.Enabled = false end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
[WIJ Corporal] Kondou |
|
|
| Report Abuse |
|
|