Kent0003
|
  |
| Joined: 28 Oct 2013 |
| Total Posts: 263 |
|
|
| 19 Jun 2014 03:45 PM |
Or do you think it's a naming error?
local isOn = true
function on() isOn = true parent.Light1.PointLight.Enabled = true end
function off() isOn = false parent.Light1.PointLight.Enabled = false end
function onClicked() if isOn == true then off() else on() end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
on()
a penny saved is a penny earned but the government will take it anyways |
|
|
| Report Abuse |
|
|
ohno1112
|
  |
| Joined: 23 Mar 2013 |
| Total Posts: 833 |
|
|
| 19 Jun 2014 03:47 PM |
you typed parent, should be Parent, and Parent is nothing.
it's script.Parent.Light1.PointLight.Enabled = true |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 03:51 PM |
Still wrong.
It's : script.Parent
|
|
|
| Report Abuse |
|
|