LUA ERROR: sys/lua/mainlua.lua:311: attempt to perform arithmetic on field '?' (a nil value)
how to fix this bug?
P/S: script run well with this bug
addhook("objectkill","okill") function okill(od,id) 	if id>0 then 	parse("killobject "..od) 	if (object(od,'typename')=='NPC') then 		if object(od,"player") == 1 then 			exp[id]= exp[id] + 5000 + (lvl[id]*500)*goti 			mo[id]=mo[id] + (20*lvl[id]) + 125 			dque[id]=dque[id]+1 			if object(od,'xtile')>=51 and object(od,'xtile')<=107 then 				local x=math.random(51,107) 				local y=math.random(2,47) 				if tile(x,y,"walkable") then 				parse("spawnnpc 1 "..x.." "..y) 				end 			else 				local x=math.random(199,255) 				local y=math.random(4,53) 				if tile(x,y,"walkable") then 				parse("spawnnpc 1 "..x.." "..y) 				end	 			end 		elseif (object(od,"player") == 2) then 			exp[id]= exp[id] + 3000 + (lvl[id]*500)*goti 			mo[id]=mo[id] + (15*lvl[id]) + 200 			local x=math.random(0,40) 			local y=math.random(97,149) 			if tile(x,y,"walkable") then 			parse("spawnnpc 2 "..x.." "..y) 			end 		elseif (object(od,"player") == 2) then 			exp[id]= exp[id] + 3000 + (lvl[id]*500)*goti 			mo[id]=mo[id] + (15*lvl[id]) + 200 			local x=math.random(0,40) 			local y=math.random(97,149) 			if tile(x,y,"walkable") then 			parse("spawnnpc 3 "..x.." "..y) 			end 		elseif object(od,"player") == 4 then 			exp[id]= exp[id] + 50000 + (lvl[id]*10000)*goti 			mo[id]=mo[id] + (500*lvl[id]) + 500000 			msg("©000255000"..player(id,"name").." killed BOSS Vortigaunt!@C") 		end 	end 	if exp[id] == asd[id] or exp[id] > asd[id] and lvl[id]<150 then 		exp[id]=exp[id]-asd[id] 		lvl[id]=lvl[id]+1 		h[id]= hi[id] 		if UsgnIds[id] > 0 then 			SaveUserStat(id) 		end 		parse("setmaxhealth "..id.." "..h[id]) 		msg2(id,"©000255000Level up!@C") 		msg("©255075000"..player(id,"name").." reached "..lvl[id].." level!") 	end 		if quest[id]==0 then quest[id]=1 end 		if dque[id]>=que[id] then 		msg2(id,"©000255000Completed Quest level "..quest[id].."!You Recive a new Quest!@C") 		msg("©000255000"..player(id,"name").." completed quest level "..quest[id].."!") 			exp[id]=exp[id]+10000*quest[id] 			mo[id]=mo[id]+5000*quest[id] 			am[id]=am[id]+quest[id] 			dme[id]=dme[id]+quest[id] 			quest[id]=quest[id]+1 			dque[id]=0 		end 	updatehud(id) end return 0 end