如何知道我的 Lua 脚本错误

我有一个代码:

----Tri So Exp 1 Con Quai : 13000
---- 51 --> 55 Danh 4 Con Len 1 Cap
----- 56 --> 60 : danh 6 con len 1 cap

Include("\\script\\global\\kinhnghiem\\exp.lua")
Include("\\script\\global\\kinhnghiem\\droprate.lua")
Include("\\script\\source\\sourcejx49.lua")

function OnDeath()
expmonter()
droprate()

tile = random(1,100)

if tile == 25 or tile == 50 or tile == 75 then
w,x,y=GetWorldPos()
toadox = x + random(-3,3)
toadoy = y + random(-3,3)
npcmapindex= SubWorldID2Idx(w)
a = random(80,94)
boss=AddNpc(a,90,npcmapindex,toadox*32,toadoy*32)
--IsBoss(boss,1)
SetNpcScript(boss, "\\script\\global\\kinhnghiem\\bossxanh.lua")
end

end;

但当我运行它时,抛出错误

error: attempt to call a nil value ScriptError 4:[1]

我如何知道错误的行数?

谢谢!

点赞