后端Lua
后端Lua
后端Lua
跨服沙巴克怎么配置
后端Lua
跨服沙巴克怎么配置
后端Lua
邮件发送多个物品怎么发送
后端Lua
txt怎么显示装备框
后端Lua
做了一个元宝捐献功能,如何查询哪个玩家捐了最多
后端Lua
称号属性在哪设置
后端Lua
consumebindmoney(actor, "元宝", cfgData.money, "称号升级扣除") 和changemoney(actor, 2, "-", cfgData.money, "称号升级扣除", false)有什么区别
后端Lua
local enemy = {hp = 100 ,attack = 10 } function enemy:new(name) local obj ={ name = name } local mt = { __newindex = function (t,k,v) if k == 'hp' and v*1 > 10000 then error('血量不能超过10000')
后端Lua
创建Enemy敌人类,要求: 类包含hp=100和attack=10两个默认属性 构造函数new接收name参数,创建对象时name写入对象自身 使用__index让对象继承类的hp和attack 使用__newindex限制:hp不能超过10000,attack不能超过1000,使用rawset写入 添加hurt方法,接收damage参数,从hp中扣除 类里面有hp了 会走__newindex吗
后端Lua
local bankaccount = { balance = 0 } local mt = { __newindex = function(t,k,v) if type(v) ~= 'number' then error('必须是数字类型') return elseif v*1 < 0 then error('不能为负数') r
后端Lua
local config = { version = '1.0'} local mt = { __newindex = function(t,k,v) if k == 'version' then print('修改成功',t,k,v) rawset(t,k,v) else print('该文件只读') end end } setmetatable(config,mt
后端Lua
local config = { version = '1.0'} local mt = { __newindex = function(t,k,v) if k == 'version' then rawset(t,k,v) print('修改成功',t,k,v) else print('该文件只读') end end } setmetatable(config,mt
后端Lua
local p = { self.math = math, self.english = english, self.xueke = xueke, } 有啥问题
后端Lua