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: Return ends function?

Previous Thread :: Next Thread 
Jellyfish403 is not online. Jellyfish403
Joined: 12 May 2010
Total Posts: 951
30 Oct 2012 04:48 PM
Does return end a function like in many other languages?
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
30 Oct 2012 04:48 PM
Oh yeah, return is a major key word in programming. Without it, functions like math.random(), pairs, wouldn't exist. No major functions wouldn't exist.
Report Abuse
Jellyfish403 is not online. Jellyfish403
Joined: 12 May 2010
Total Posts: 951
30 Oct 2012 04:51 PM
So it ends the function no matter what right?
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
30 Oct 2012 04:54 PM
the scope, rather.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
30 Oct 2012 04:54 PM
Not necessarily. It depends what you want.

Say you want the function to do a certain, specific task.

function Transparent(part)
part.Transparency = 1
end
Transparent(game.Workspace.Part)

That doesn't have return in it. It does a certain task by always making Part transparent to 1.

Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
30 Oct 2012 04:55 PM
Whoops, I didn't read it write. Sorry!

I thought you asked something about if you always use return in a function. NVM
Report Abuse
morganCarr is not online. morganCarr
Joined: 21 Sep 2010
Total Posts: 19179
30 Oct 2012 05:02 PM
[ Content Deleted ]
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
30 Oct 2012 05:50 PM
a Huge Thing You would use return for, is going through Lists.


Ok = {"Hi","Bye"}

function check(obj)
for i = 1,#Ok do
if Ok[i]:lower()==obj.Name:lower() then
return true
end
end
return false
end

print(check(workspace.Part))
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