--脚本命令RunLuaScript调用LUA脚本
function RunLuaScript8(Actor, item)
local Actorname = Actor:getCharName()
local RaceId = Actor:getRace()--种族ID
local item = Actor:getUseItem(0)
if item then
local ItemName = item:getName()--物品名称
local ItemLooks = item:getLooks() --内观代码
local ItemMakeIndex = item:getMakeIndex()--制造ID
print("["..ItemName.."]内观ID:["..tostring(ItemLooks))
end
end
报错如下
2021-05-30 13:09:52 {0219} [string "D:\Mirserver360\Mir200\LuaScripts\System\BindEvent.lua"]:710: attempt to call a nil value (method 'getLooks')
stack traceback:
[string "D:\Mirserver360\Mir200\LuaScripts\System\BindEvent.lua"]:710: in function 'RunLuaScript8'
BUG重现方式:
getLooks 获取数据库中Looks
--脚本命令RunLuaScript调用LUA脚本
function RunLuaScript8(Actor, item)
local Actorname = Actor:getCharName()
local RaceId = Actor:getRace()--种族ID
local item = Actor:getUseItem(0)
if item then
local ItemName = item:getName()--物品名称
local ItemLooks = item:getLooks() --内观代码
local ItemMakeIndex = item:getMakeIndex()--制造ID
print("["..ItemName.."]内观ID:["..tostring(ItemLooks))
end
end
2021-05-30 13:09:52 {0219} [string "D:\Mirserver360\Mir200\LuaScripts\System\BindEvent.lua"]:710: attempt to call a nil value (method 'getLooks')
stack traceback:
[string "D:\Mirserver360\Mir200\LuaScripts\System\BindEvent.lua"]:710: in function 'RunLuaScript8'