|
| 10 Jun 2012 07:22 PM |
How do I end a function that is running for example.
script.Parent.Touched:connect(function () if lol == derp then (STOPTHEFUCTIONHERE) Rest of script here end end) |
|
|
| Report Abuse |
|
|
superior
|
  |
| Joined: 13 Apr 2008 |
| Total Posts: 1662 |
|
|
| 10 Jun 2012 07:23 PM |
script.Parent.Touched:connect(function () if lol == derp then end Rest of script here end) |
|
|
| Report Abuse |
|
|
|
| 10 Jun 2012 07:24 PM |
@superior
Nope
script.Parent.Touched:connect(function () if lol == derp then return end --Rest of script here end)
It's the function stops and returns no value.
-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]- |
|
|
| Report Abuse |
|
|
|
| 10 Jun 2012 07:25 PM |
| I want it to stop the function not the if statement. |
|
|
| Report Abuse |
|
|
| |
|
superior
|
  |
| Joined: 13 Apr 2008 |
| Total Posts: 1662 |
|
|
| 10 Jun 2012 07:26 PM |
| Ohmygoodness. I completely forgot. >.< Wow. I'm ashamed. |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 10 Jun 2012 07:27 PM |
@Wicked The 'return' keyword ends the nearest function in its scope. It won't stop the 'if' statement, but the whole it's located at. |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 10 Jun 2012 07:28 PM |
| ...and I missunderstood who the comment was for. *Flies away* |
|
|
| Report Abuse |
|
|