测试代码如下:
- function Test_func(Actor)--测试函数
- print("进入[Test_func]")
- local Play = s.obj.getPlayer("暴十用")--获取指定角色名的玩家对象
- local itemName = "30阶朱雀勋章"
- if Play then
- Play:giveStateItem("30阶朱雀勋章", 1, 1, 0, 0, 1, 1, 1, 0, 3, 0)
- local Item = Play:getBagItemEx(itemName)
- if Item then Play:takeOnItem(Item:getMakeIndex(), 19) end
- end
-
- local heroActor = Play:getHero()
- if heroActor then
- Hum_Attr.ClearBagItems(heroActor)
- --Hum_Attr.takeonFashionItem(heroActor)
- heroActor:giveStateItem("30阶朱雀勋章", 1, 1, 0, 0, 1, 1, 1, 0, 3, 0)
- local Item = heroActor:getBagItemEx(itemName)
- if Item then heroActor:takeOnItem(Item:getMakeIndex(), 19) end
- end
- end
复制代码
补充内容 (2025-9-30 02:08):
14行记得屏蔽掉。。。 |