HILO 0 Report post Posted January 6, 2017 Hi, I've been getting this error on lua_err.log, Anyone have a clue? Quote forge.lua:1101: attempt to perform arithmetic on field `?' (a nil value) here is the code: StoneInfo[0]=0 StoneInfo[1]=0 StoneInfo[2]=0 StoneLv[0]=0 StoneLv[1]=0 StoneLv[2]=0 StoneInfo[0],StoneInfo[1],StoneInfo[2],StoneLv[0],StoneLv[1],StoneLv[2] = CheckStoneInfo ( Num ) local AddCheck = 0 local i = 0 local j = 0 for i = 0 , 2 , 1 do if StoneInfo [i] ~= nil and StoneInfo [i] ~=0 then if StoneAttrType[StoneInfo [i]] == ITEMATTR_VAL_MNATK then local Itemattr_Type1 = StoneAttrType[StoneInfo [i]] local Itemattr_Type2 = Itemattr_Type1 + 1 local ItemAttrEff = 0 local num_stone=0 local lv_stone=0 if StoneLv[i]>0 and StoneLv[i]<=9 then lv_stone=StoneLv[i] end if StoneInfo [i]>=0 and StoneInfo [i]<=StoneEff_Num then num_stone=StoneInfo [i] ItemAttrEff =StoneEff [num_stone] * lv_stone end AddCheck = AddItemFinalAttr ( Item , Itemattr_Type1 , ItemAttrEff ) if AddCheck == 0 then LG("check_item_final","AddCheck Failed") end AddCheck = AddItemFinalAttr ( Item , Itemattr_Type2 , ItemAttrEff ) if AddCheck == 0 then LG("check_item_final","AddCheck Failed") end else local Itemattr_Type = StoneAttrType[StoneInfo [i]] local ItemAttrEff = 0 local num_stone=0 local lv_stone=0 if StoneLv[i]>0 and StoneLv[i]<=9 then lv_stone=StoneLv[i] end if StoneInfo [i]>=0 and StoneInfo [i]<=StoneEff_Num then num_stone=StoneInfo [i] ItemAttrEff =StoneEff [num_stone] * lv_stone -- this is the line mentioned on log. end AddCheck = AddItemFinalAttr ( Item , Itemattr_Type , ItemAttrEff ) if AddCheck == 0 then LG("check_item_final","AddCheck Failed") end end end end end Quote Share this post Link to post Share on other sites
Angelix 375 Report post Posted January 6, 2017 Have you by any chance modified the gem variables? Perhaps added a new gem or something and forgot to increase values? Didn't declare something right I guess. Quote Share this post Link to post Share on other sites
Shako 97 Report post Posted January 6, 2017 (edited) What i recommend is add this line after num_stone = StoneInfo Notice ( "StoneEff = "..StoneEff[num_stone].." , Lv_Stone = "..lv_stone.."" ) It does not solve the problem, but it will point you what the null value is to be fixed. @HILO Edited January 6, 2017 by Shako 1 Quote Sunny Go! Online pko.host Share this post Link to post Share on other sites
HILO 0 Report post Posted January 6, 2017 Quote Have you by any chance modified the gem variables? Perhaps added a new gem or something and forgot to increase values? Didn't declare something right I guess. Added the cloak gems before, but didn't notice the error before, and those gems aren't even used on server now. Quote Share this post Link to post Share on other sites
Vasil 71 Report post Posted January 6, 2017 Mind posting your Variable.lua @HILO or posting the whole gems variables?I experienced the error before with the cloak gems but i fixed it from the variables. Quote Share this post Link to post Share on other sites