As I am aware, not may people know how to use metatables. This is going to focus on setmetatable() and methods as functions, using the metatable.
First, you will need a table that you wish to use the meta table with:

local tab = {}

Then, you will need to make function to create the table:

function tab.newMeta(name)
    local self = setmetatable({}, {__index = tab}) = name
    return self

In that function we create the table, and return it.
Then to use the function:

local variable
function start() --say you want to call this each time the player dies
    variable = tab.newMeta("I'm a table!")

Now we have the table, we can make methods for it! (make sure to put the methods before you create the table)
Here's an example of a method we could create now:

function tab:updateMetaTableName(newname) = newname
variable:updateMetaTableName("I have a new name!")

Notice how we now use "self". This is because the method knows that "self" is the table you want to update.
You can print out the name now:


Here's our whole script:

More info on Metatables :

Sorry if this is badly worded, This is my first tutorial!