Tomb Raider - code help - what are functions - lua default code for level

@LordMaddog perhaps this illustration will help?

The commas separate things that you send to a function. So for instance if we use our previous example of the function that cleanAndScrub()'s dishes this is one way we could send many dishes to be cleaned:

local dish1 = "A dirty Dish"
local dish2 = "A grimy Dish"
local dish3 = "A filthy Dish"
cleanAndScrub( dish1, dish2, dish3 )

remember that this is just an example and the “dishes” we are talking about are really just strings.

in the pet example we are sending two things to the function on(). A string "hear" and the name of a function speak.

speak would need to be defined in your code:

local speak = function()
    pet:say(" I am talking ")
end

And if you are asking why are we using the word argument for programming and wondering why we should be fighting with our functions and not having a constructive discussion here is a nice read:
1 Like