Advertisement
Guest User

Untitled

a guest
Dec 1st, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. local function add_two_numbers(number_one, number_two) -- Function means the following is a function definition.
  2. -- add_two_numbers is the function name.
  3. -- number_one and number_two are arguments.
  4.  
  5. local number_three = number_one + number_two -- Sets number_three variable to the value of number_one plus number_two
  6. return number_three -- Returns the value behind the return to the calling code.
  7.  
  8. end -- You need to close the function with end keyword.
  9.  
  10. print(add_two_numbers(5, 2)) -- Prints 7.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement