generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: How do I end a function.

Previous Thread :: Next Thread 
WickedErasor is not online. WickedErasor
Joined: 24 Dec 2009
Total Posts: 1375
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 is not online. 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
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
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
WickedErasor is not online. WickedErasor
Joined: 24 Dec 2009
Total Posts: 1375
10 Jun 2012 07:25 PM
I want it to stop the function not the if statement.
Report Abuse
WickedErasor is not online. WickedErasor
Joined: 24 Dec 2009
Total Posts: 1375
10 Jun 2012 07:25 PM
@swimguy

Ty
Report Abuse
superior is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image