|
| 21 Dec 2011 02:13 PM |
if OnTouched script.Parent.Transparency= 1 if OnClicked() script.Parent.CanColide= false
end end script.Parent.Touched:connect(OnTouched) script.Parent.ClickDetector.MouseClick:connect(OnClicked)
I've never made an 'if' script before, and I've never researched how to make one, so I just want to know if it would work, and if not, why. |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Dec 2011 02:23 PM |
No, this wouldn't work at all... For a few reasons...
> if OnTouched
Well... First of all, OnTouched isn't defined, and secondly, the if statement needs a 'then'. So it would be:
if OnTouched then -- BTW, this won't work unless you have OnTouched defined as a variable
The second thing is...
> if OnClicked()
Well... Unless OnClicked() returns a boolean (true or false), then this won't work. Also, it has no 'then' to go with it. |
|
|
| Report Abuse |
|
|
|
| 21 Dec 2011 02:41 PM |
Thanks for the help. If you wouldn't mind, could you write up what the finished script would be?
|
|
|
| Report Abuse |
|
|
Kepie
|
  |
| Joined: 12 Nov 2011 |
| Total Posts: 884 |
|
|
| 21 Dec 2011 02:56 PM |
@TheNewScripter, you forgot to put (hit) on the OnTouched xD like this:
OnTouched(hit) |
|
|
| Report Abuse |
|
|