Lua uses the `self` variable rather than `this`.  It also looks like you're implementing basic classes.  This should be done with metatables. Eg:
```lua
local meta = {}
meta.__index = meta

function meta:get_formspec()
    [...]
end

function make_object()
    local o = {}
    setmetatable(o, meta)
    return o
end
```