如何知道我的Lua脚本错误

时间:2018-08-19 05:12:04

标签: 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;

但是当我运行它时会抛出错误

错误:尝试调用nil值     ScriptError 4:[1]

我怎么知道错误线?

谢谢!

0 个答案:

没有答案