ash877
|
  |
| Joined: 18 Feb 2008 |
| Total Posts: 5142 |
|
|
| 01 Feb 2014 10:02 PM |
Ok I made a new thread because I ran into a new problem. -.-
function show(val) local stuff=game.workspace:GetChildren() for i=1,#stuff do if stuff[i].Name=="Door" then if stuff[i].Number.Value==val then stuff[i].Door.Transparency=1 wait(5) stuff[i].Door.Transparency=0 end end end end
for i=1, #stuff do if stuff[i].Name=="Door" then stuff[i].Door.ClickDetector.MouseClick:connect(show(stuff[i].Number.Value)) end end
---the only error is attempt to call a nil value; disconnected because of exception. What!? I think I set it up right D: |
|
|
| Report Abuse |
|
|
|
| 01 Feb 2014 10:06 PM |
| In your for loop. Where did you define 'stuff'? I mean the part where it says 'for i=1, #stuff do' |
|
|
| Report Abuse |
|
|
ash877
|
  |
| Joined: 18 Feb 2008 |
| Total Posts: 5142 |
|
|
| 01 Feb 2014 10:07 PM |
| :GetChildren() is there, i just didn't put it in this post |
|
|
| Report Abuse |
|
|
ash877
|
  |
| Joined: 18 Feb 2008 |
| Total Posts: 5142 |
|
|
| 01 Feb 2014 10:08 PM |
i mean stuff=game.workspace:GetChildren()
is already there i forgot to post it in the thread. |
|
|
| Report Abuse |
|
|
shawnyg
|
  |
| Joined: 21 Apr 2011 |
| Total Posts: 1428 |
|
|
| 01 Feb 2014 10:09 PM |
@Fire, 2nd line..
~Hope I helped! If you need a script, PM me.~ ~The G~ ~CAT General Shawnyg~ |
|
|
| Report Abuse |
|
|
jonesj627
|
  |
| Joined: 06 Oct 2010 |
| Total Posts: 1496 |
|
|
| 01 Feb 2014 10:15 PM |
function show(val) what the heck is val?!! make val into a variable val = 0 |
|
|
| Report Abuse |
|
|
ash877
|
  |
| Joined: 18 Feb 2008 |
| Total Posts: 5142 |
|
|
| 01 Feb 2014 10:19 PM |
| val is the number value from each of stuff |
|
|
| Report Abuse |
|
|
ash877
|
  |
| Joined: 18 Feb 2008 |
| Total Posts: 5142 |
|
| |
|
|
| 01 Feb 2014 11:10 PM |
| You defined stuff as local, so outside of the first function is is considered nil. Try doing just 'stuff = Workspace:GetChildren()' |
|
|
| Report Abuse |
|
|