Others have already answered, so my advice is: you should learn the Object-Oriented Programming.
local Handle = {}
Handle.Value = 0
function Handle:IncreaseValue()
self.Value += 1
end
You can simulate class with metatable.
--< Variables
local Person = {}
local PersonClass = {}
PersonClass.__index = PersonClass
--< Methods
function PersonClass:GetName()
return self.Name
end
--< Constructor
function Person.new(name, age)
local self = setmetatable({}, PersonClass)
self.Name = name
self.Age = age
return self
end
--< Initailize
local jackObj = Person.new("Jack", 36)
print(jackObj:GetName())
Object-Oriented Programming is very useful and can save a lot of time in big project. I therefore encourage you to do research on this subject or read the articles by clicking on the words in blue.