local player={level=0,money=0,name=""}
function player:new(o,l,m,n)
o=o or {}
setmetatable(o,player)
self.__index=self
self.level=l or 0
self.money=m or 0
self.name=n or "none"
return o
endfunction player:getName()
print(self.name)
endmike=player:new(nil,23,4467,"Mike")
mike:getName()
Lua 面对对象
最新推荐文章于 2021-05-18 23:56:06 发布