local U10 = 0
if RaceId == 0 then
U10 = actor:getVal_U(10)
end
执行报错,上个版本是没有问题的,类似的报错非常多,想知道是我写的有问题还是?
2021-01-12 19:55:14 {0108} [string "D:\MirServer3\Mir200\LuaScripts\System\BindEvent.lua"]:461: attempt to call a nil value (method 'getVal_U')
stacktraceback:"D:\MirServer3\Mir200\LuaScripts\System\BindEvent.lua"]:461: in function 'on_actor_in_game'
2021-01-13 1:52:22 {0111} [string "D:\MirServer3\Mir200\LuaScripts\System\BindEvent.lua"]:137: attempt to call a nil value (method 'getVal_U')
stack traceback:
[string "D:\MirServer3\Mir200\LuaScripts\System\BindEvent.lua"]:137: in function 'on_actor_in_game'
代码是
function on_actor_in_game(actor)
local U10 = 0
local RaceId = actor:getRace()
if (RaceId == 0) and (actor ~= nil) then
U10 = actor:getVal_U(10)
end
end