FapFap 13 Report post Posted June 14, 2019 (edited) I made an Exchanger NPC and im having such error at lua_err.txt [06-14 17:30:43]resource/script/MisSdk/NpcSdk.lua:173: attempt to index local `exchangeData' (a nil value) Exchanger NPC Script: function exch_1 () Talk( 1, "Exchanger: Hi, welcome! How can I help you?" ) Text( 1, "Exchange Item", SendExchangeXData) Text( 1, "Nothing...",CloseTalk ) InitExchangeX() ExchangeDataX( 7505 , 300 , 7591 , 1 , 1) end NpcSdk.lua Function: function SendExchangeXData( character, npc, exchangeData ) local packet = GetPacket() WriteCmd( packet, CMD_MC_EXCHANGEDATA ) local npcid = GetCharID( npc ) WriteDword( packet, npcid ) if exchangeData.count ~= nil then WriteWord( packet, exchangeData.count ) for n = 1, exchangeData.count, 1 do WriteWord( packet, exchangeData.srcid[n] ) WriteWord( packet, exchangeData.srcnum[n] ) WriteWord( packet, exchangeData.tarid[n] ) WriteWord( packet, exchangeData.tarnum[n] ) end else WriteWord( packet, 0 ) end SendPacket( character, packet ); end Error shows at SystemNotice after clicking "Exchange Item" Edited June 14, 2019 by FapFap Quote Share this post Link to post Share on other sites
Leba 12 Report post Posted June 14, 2019 You have to add an appropriate ChangeItemList[] line in variable.lua too if I remember right. Quote Share this post Link to post Share on other sites
FapFap 13 Report post Posted June 20, 2019 On 6/14/2019 at 8:03 PM, Leba said: You have to add an appropriate ChangeItemList[] line in variable.lua too if I remember right. I already did, but its showing the error that i posted here Quote Share this post Link to post Share on other sites