Parameters

Parameters are values but usually between parenthesis that serve a purpose of being changed, set a value to it, or declared. You can write as many parameters as you want in a function. A example is provided below.

local function myFunction(Apples, Trees)
    print(Apples)
end

myFunction("Juicy", "Green")

This function holds "Apples" and "Trees" Parameters. These parameters can be set to values and strings. We set the apples parameter to "Juicy". We know this because when we ran the function we had the parameters "Juicy" and since Apples is first in the function parameter, and "Juicy" is the first parameter when running the function, if we print apples, we will get "Juicy" because that's the parameters value. The same goes with Trees. We use the format: "local function (FunctionName)(Param1, Param2)" And for declaring "(FunctionName)(Value1, Value2)"

Last updated