First off, the semi-colons aren't required at all.
Next, you'd need to define the function outside of the table's body for implicit call using self
.
And, string concatenation is done using ..
and not +
local person = {
name = 'Saucy Jack',
}
function person:speak() -- or function person.speak(self)
print("Hi, my name is "..self.name)
end
Here's a working codepad sample.