Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What does the keyword "return" means, and does?

Asked by 10 years ago

What does the keyword "return" means/ and what it does?

1 answer

Log in to vote
1
Answered by 10 years ago

Return stops functions in a script.

e.g

function addNumbers(num1, num2)
    return num1 + num2
end

a = addNumbers(3, 5)
print(a)

If you have statements before end and after return, you'll receive errors.

So everytime you have a return, make sure to end it afterwards.

0
Thanks, I need an example code with return in it if u can Coolviper630 95 — 10y
0
I've edited the post and got one from the roblox wiki. Fidgeting 60 — 10y
Ad

Answer this question