Uiom1
|
  |
| Joined: 17 Mar 2015 |
| Total Posts: 364 |
|
| |
|
Uiom1
|
  |
| Joined: 17 Mar 2015 |
| Total Posts: 364 |
|
| |
|
Luminak
|
  |
| Joined: 27 May 2012 |
| Total Posts: 2809 |
|
| |
|
Uiom1
|
  |
| Joined: 17 Mar 2015 |
| Total Posts: 364 |
|
| |
|
|
| 30 May 2015 08:44 PM |
| That's not even what it does at all. |
|
|
| Report Abuse |
|
|
Luminak
|
  |
| Joined: 27 May 2012 |
| Total Posts: 2809 |
|
|
| 30 May 2015 08:49 PM |
| ok fine it returns the function |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 30 May 2015 09:25 PM |
function value() return 2; end
print(value()) |
|
|
| Report Abuse |
|
|