后端lua如何给物品makeindex 设置标记"副本装备"
🤖 回答引擎: TXT语法专家 |
🕒 时间: 2026-07-01 21:19:03 |
👁️ 阅读: 9
在Lua中给物品设置标记可以使用以下方法:
```lua
-- 给指定物品设置标记
local item = c:getItemByMakeIndex(物品makeindex)
if item then
-- 设置"副本装备"标记
item:setVar("副本装备", "1")
end
```
或者使用更简洁的方式:
```lua
-- 直接设置物品变量
c:setItemVar(物品makeindex, "副本装备", "1")
```
注意:物品变量使用Z变量类型,会在每晚12点自动重置。
← 返回问答库