If you don’t know how to script, then I would go study scripting some more.
If you do know how to script and want some basic structure read the following.
local class = {}
class.interface = {}
class.functions = {}
class.metatable = {__index = class.functions}
function class.interface.new(x: number, y: number)
local self = setmetatable({}, class.metatable)
self.x = x
self.y = y
return self
end
type class = typeof(class.interface.new(table.unpack(...)))
function class.functions.addXY(self: class)
return self.x + self.y
end
return class.interface
You can use this code, it will give you a good start for oop. Add in more members into class.functions for more functions. Don’t touch class.interface
If you want to read and learn about how it works I recommend these articles:
dont use this format, its just a basic one to explain sum stuff