nocnoc1
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 2193 |
|
|
| 06 Sep 2013 11:36 PM |
function clicky() if game.Workpsace.Gate.gate.Transparancy == 0.2 then game.Workpsace.Gate.gate.Transparancy = 0.18 elseif game.Workpsace.Gate.gate.Transparancy == 0.18 then game.Workpsace.Gate.gate.Transparancy = 0.2 end end
script.Parent.ClickDetector.MouseClick:connect(clicky)
And this is the output:
21:36:24.665 - function clicky() if game.Workpsace.Gate.gate.Transparancy:10: attempt to index global 'script' (a nil value) 21:36:24.668 - Script 'function clicky() if game.Workpsace.Gate.gate.Transparancy', Line 10 21:36:24.669 - stack end |
|
|
| Report Abuse |
|
|
nocnoc1
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 2193 |
|
| |
|
|
| 06 Sep 2013 11:39 PM |
function clicky( if game.Workpsace.Gate.gate.Transparancy = 0.2 then game.Workpsace.Gate.gate.Transparancy = 0.18
elseif game.Workpsace.Gate.gate.Transparancy = 0.18 then game.Workpsace.Gate.gate.Transparancy = 0.2 end end)
script.Parent.ClickDetector.MouseClick:connect(clicky)
ehh might work idk. too lazy to check ._. |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2013 11:42 PM |
Wait.. I think I just sorta confused rbx.Lua with php o.e
derp..
well one thing is for sure, you have the ='s wrong. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Sep 2013 11:46 PM |
if statement == condition then elseif statement == condition then else end
"elseif code" is equivalent to "else if code end" but it much faster. |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2013 11:48 PM |
| omfg nvm, I really need to go to sleep, I'm getting retarted. |
|
|
| Report Abuse |
|
|
nocnoc1
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 2193 |
|
| |
|
jd678
|
  |
| Joined: 18 Apr 2008 |
| Total Posts: 11529 |
|
|
| 06 Sep 2013 11:56 PM |
e = 0
function clicky() if e == 0 then game.Workpsace.Gate.gate.Transparancy = 0.18 e = 1 else if e == 1 then game.Workpsace.Gate.gate.Transparancy = 0.2 e = 0 end end end
script.Parent.ClickDetector.MouseClick:connect(clicky)
--@Jd678_RBLX |
|
|
| Report Abuse |
|
|
nocnoc1
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 2193 |
|
|
| 07 Sep 2013 12:01 AM |
| Jd that doesn't work either. |
|
|
| Report Abuse |
|
|
nocnoc1
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 2193 |
|
| |
|
Excellus
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 3939 |
|
|
| 07 Sep 2013 12:18 AM |
| you spelled "Transparency" wrong. |
|
|
| Report Abuse |
|
|
nocnoc1
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 2193 |
|
|
| 07 Sep 2013 12:23 AM |
| I did o.e or did JD spell it wrong? |
|
|
| Report Abuse |
|
|
|
| 07 Sep 2013 12:24 AM |
| you did noc, jd and me got it wrong because we copied "Transparancy" from you. |
|
|
| Report Abuse |
|
|
jd678
|
  |
| Joined: 18 Apr 2008 |
| Total Posts: 11529 |
|
|
| 07 Sep 2013 02:35 AM |
oh, yeah I just copied your script and edited it.
Didn't even notice the spelling
--@Jd678_RBLX |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 07 Sep 2013 10:55 AM |
JD you are missing an end. Add an end or remove the space between else and if |
|
|
| Report Abuse |
|
|