Elazul 0 Report post Posted December 25, 2020 Hello I am having an issue with the Furnace of Immortality, it doesn't let me upgrade equipment. Be it Black Dragon, Kylin or Lv 70 Boss Stones. I just get a System Notice saying "Request was rejected", when I go into lua.err.text I see... [12-25 18:14:17]DoString can_tichun_item [12-25 18:14:17]./resource/script\calculate\forge.lua:3593: `for' limit must be a number If I open forge.lua and look for the line 3593 I get "for i = 1, Upgrade.Items do" The function is: function can_tichun_item_main(Table) local role = 0 local ItemBag = {} local ItemCount = {} local ItemBagCount = {} local ItemBag_Now = 0 local ItemCount_Now = 0 local ItemBagCount_Num = 0 role, ItemBag, ItemCount, ItemBagCount, ItemBag_Now, ItemCount_Now, ItemBagCount_Num = Read_Table(Table) if ItemCount[0] ~= 1 or ItemCount[1] ~= 1 or ItemBagCount[0] ~= 1 or ItemBagCount[1] ~= 1 then SystemNotice(role,"Equipment quantity illegal.") return 0 end local ItemMain = GetChaItem(role, 2, ItemBag[0]) local ItemCatalyst = GetChaItem(role, 2, ItemBag[1]) local ItemType_mainitem = GetItemType(ItemMain) local ItemType_otheritem = GetItemType(ItemCatalyst) local ItemMainID = GetItemID(ItemMain) local ItemCatalystID = GetItemID(ItemCatalyst) local ItemMainID_Lv = GetItemLv(ItemMain) local ItemCatalystID_Lv = GetItemLv(ItemCatalyst) local MainID = ItemMainID local CatalystID=ItemCatalystID if MainID > 5000 then MainID = GetItemAttr(ItemMain, ITEMATTR_VAL_FUSIONID) end local Check = 0 for i = 1, Upgrade.Items do if ItemMainID == Upgrade[i].ID then if ItemCatalystID == Upgrade[i].Catalyst then Check = 1 end end end if Check == 0 then SystemNotice(role ,"Please use the correct equipment and upgrade stone.") return 0 end local Money_Need = gettichun_money_main(Table) local Money_Have = GetChaAttr(role, ATTR_GD) if Money_Need > Money_Have then SystemNotice(role,"Insufficient Gold, unable to upgrade equipment.") return 0 end return 1 end What could be the issue? All other interactions with the Furnace work as they should (I can extract gems, recharge corals and repair lifeskill tools). Special set upgrade allow me to select any item in the inventory, while the other options don't. I am using version 1.36. Thank you Quote Share this post Link to post Share on other sites
Eviles 179 Report post Posted December 25, 2020 Hello @Elazul! First we talk about the "for" loop which you having problem. https://www.tutorialspoint.com/lua/lua_for_loop.htm The line error from log in code: for i = 1, Upgrade.Items do It trying to get size of the table for upgrade items, the correct way should be like that: for i = 1, table.getn(Upgrade) do replace to the following above in codes and it work. 1 Quote Share this post Link to post Share on other sites
Elazul 0 Report post Posted December 25, 2020 Thank you very much Quote Share this post Link to post Share on other sites
Rogue 19 Report post Posted December 29, 2020 On 12/25/2020 at 11:35 PM, Eviles said: Hello @Elazul! First we talk about the "for" loop which you having problem. https://www.tutorialspoint.com/lua/lua_for_loop.htm The line error from log in code: for i = 1, Upgrade.Items do It trying to get size of the table for upgrade items, the correct way should be like that: for i = 1, table.getn(Upgrade) do replace to the following above in codes and it work. or simply: for i = 1, #Upgrade do Quote Share this post Link to post Share on other sites
Eviles 179 Report post Posted December 29, 2020 7 hours ago, Snowfall said: or simply: for i = 1, #Upgrade do This lenght operator introducted only after Lua v5.1, gameserver 1.x uses Lua v5.0. Quote Share this post Link to post Share on other sites