doneyes
|
  |
| Joined: 21 Mar 2008 |
| Total Posts: 3466 |
|
|
| 11 Feb 2012 04:50 PM |
function clicked()
wait(1)
script.Parent.Parent.Hold2:Remove() script.Parent.Parent.Thruster.Smoke.Enabled = true
wait(3)
script.Parent.Parent.Thruster.BodyThrust.force = Vector3.new(0,1000000,0)
script.Parent.ClickDetector.MouseClick:connect(clicked) |
|
|
| Report Abuse |
|
|
noobkid
|
  |
| Joined: 17 Sep 2007 |
| Total Posts: 649 |
|
| |
|
zTopz
|
  |
| Joined: 08 Feb 2012 |
| Total Posts: 17 |
|
|
| 11 Feb 2012 04:57 PM |
| Most people put ends at the end of their scirpts XD |
|
|
| Report Abuse |
|
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 11 Feb 2012 05:03 PM |
function clicked()
wait(1) script.Parent.Parent.Hold2:Remove() script.Parent.Parent.Thruster.Smoke.Enabled = true wait(3) script.Parent.Parent.Thruster.BodyThrust.force = Vector3.new(0,1000000,0) end
script.Parent.ClickDetector.MouseClick:connect(clicked)
or
script.Parent.ClickDetector.MouseClick:connect(function() wait(1) script.Parent.Parent.Hold2:Remove() script.Parent.Parent.Thruster.Smoke.Enabled = true wait(3) script.Parent.Parent.Thruster.BodyThrust.force = Vector3.new(0,1000000,0) end) |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 11 Feb 2012 05:22 PM |
@Phellem
There's no difference except the second script is an anonymous function. |
|
|
| Report Abuse |
|
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 11 Feb 2012 05:28 PM |
@miz656
I know. I just like to show an anonymous function. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 11 Feb 2012 05:29 PM |
| Same here. Though, I wouldn't use it because he might not know how to use it. |
|
|
| Report Abuse |
|
|
doneyes
|
  |
| Joined: 21 Mar 2008 |
| Total Posts: 3466 |
|
| |
|
noobkid
|
  |
| Joined: 17 Sep 2007 |
| Total Posts: 649 |
|
|
| 11 Feb 2012 05:38 PM |
| The one without a variable holding the function... |
|
|
| Report Abuse |
|
|
doneyes
|
  |
| Joined: 21 Mar 2008 |
| Total Posts: 3466 |
|
|
| 11 Feb 2012 05:42 PM |
I used your script, then it worked. Then I added a little bit of something to it, and it stopped working. wtf?
function clicked()
script.Parent.Parent.Door.Transparency = 0 script.Parent.Parent.Door.CanCollide = true wait(1) script.Parent.Parent.Hold2:Remove() script.Parent.Parent.Thruster.Smoke.Enabled = true wait(3) script.Parent.Parent.Thruster.BodyThrust.force = Vector3.new(0,120000,0) end
script.Parent.ClickDetector.MouseClick:connect(clicked) |
|
|
| Report Abuse |
|
|
| |
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 11 Feb 2012 05:45 PM |
script.Parent.Parent.Hold2:Remove()
May caused the error. Since you removed it the first time, the second time, the object isn't there. Making it stop working the second time.
Hoped that made sense. |
|
|
| Report Abuse |
|
|
doneyes
|
  |
| Joined: 21 Mar 2008 |
| Total Posts: 3466 |
|
|
| 11 Feb 2012 05:58 PM |
| What, do you think I'm in build mode? I'm in studio. You hit the rewind button and play it over basically. |
|
|
| Report Abuse |
|
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 11 Feb 2012 06:01 PM |
Okay. So you only added: script.Parent.Parent.Door.Transparency = 0 script.Parent.Parent.Door.CanCollide = true
Check if 'Door' is in script.Parent.Parent. Make sure it's spelled correctly.
If you still have problems, check your output. |
|
|
| Report Abuse |
|
|
doneyes
|
  |
| Joined: 21 Mar 2008 |
| Total Posts: 3466 |
|
| |
|