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 » Scripters
Home Search
 

Re: what does 'return' do in lua

Previous Thread :: Next Thread 
Uiom1 is not online. Uiom1
Joined: 17 Mar 2015
Total Posts: 364
30 May 2015 08:23 PM
sry im new
Report Abuse
Uiom1 is not online. Uiom1
Joined: 17 Mar 2015
Total Posts: 364
30 May 2015 08:30 PM
z
Report Abuse
Luminak is not online. Luminak
Joined: 27 May 2012
Total Posts: 2809
30 May 2015 08:37 PM
repeat the code in output
Report Abuse
Uiom1 is not online. Uiom1
Joined: 17 Mar 2015
Total Posts: 364
30 May 2015 08:38 PM
thx u rock 2
Report Abuse
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
30 May 2015 08:44 PM
That's not even what it does at all.
Report Abuse
Luminak is not online. Luminak
Joined: 27 May 2012
Total Posts: 2809
30 May 2015 08:49 PM
ok fine it returns the function
Report Abuse
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
30 May 2015 08:50 PM
A function is a set of instructions that can be called upon later in your script. Within that function, if it returns something, that value is given back to the caller. It also stops the execution of the function. Example:

function Add(number1, number2)
local sum = number1 + number2

return sum -- give this value back
end

local sum = Add(5, 5)

print(sum) -- 10
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
30 May 2015 08:51 PM
Return returns a variable.
In normal programming there are different types of functions.
Void would return nothing and things like IENumerators would return integers.
In ROBLOX return can be used to repeat things if you want to be super not really complex-ish.
But it's to return variables.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
30 May 2015 09:24 PM
Returns execution to the caller and returns values that the caller gets back.
Report Abuse
025110 is not online. 025110
Joined: 23 Nov 2012
Total Posts: 57661
30 May 2015 09:25 PM
function value()
return 2;
end

print(value())
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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