Radian Posted September 23, 2019 Share Posted September 23, 2019 Hey guys, can i request this kind of script? I am having issue on how to start on it. How it works, is If player got the item from any of the list, he/she can select to switch it 1:1 from the same list. list example: setarray .item_list, 32037,32031,32326,32035,32034,32032,32033,32036,32325,32324; I was hoping if possible to make 3 different list for it. Thank you so much. Quote Link to comment Share on other sites More sharing options...
0 crazyarashi Posted September 24, 2019 Share Posted September 24, 2019 - script item_swap -1,{ for([email protected] = 0; [email protected] < .size; [email protected]++){ [email protected]$ += "List " + ([email protected]+1) + ":"; } mes "Select a list."; next; [email protected] = select([email protected]$) - 1; explode([email protected]$,.item_list$[[email protected]],","); for([email protected] = 0; [email protected] < getarraysize([email protected]$); [email protected]++){ [email protected] = atoi([email protected]$[[email protected]]); [email protected][[email protected]] = [email protected]; if(countitem([email protected])){ [email protected][getarraysize([email protected])] = [email protected]; [email protected]$ += getitemname([email protected]) + ":"; } else { continue; } } mes "Select the item you want to swap."; next; [email protected] = select([email protected]$) - 1; [email protected]_id = [email protected][[email protected]]; [email protected] = inarray([email protected],[email protected]_id); for([email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++){ if([email protected] == [email protected]) continue; [email protected][getarraysize([email protected])] = [email protected][[email protected]]; [email protected]$ += getitemname([email protected][[email protected]]) + ":"; } mes "select the item you want to swap into."; next; [email protected] = select([email protected]$) - 1; delitem [email protected]_id,1; getitem [email protected][[email protected]],1; end; OnInit: setarray .item_list$,"501,502,503,504,505","506,507,508,509,510"; .size = getarraysize(.item_list$); end; } Haven't tested this but pretty sure it will work.. 1 Quote Link to comment Share on other sites More sharing options...
0 Radian Posted September 24, 2019 Author Share Posted September 24, 2019 Anyone got an idea how the method works? I'll work on the rest. thank you Quote Link to comment Share on other sites More sharing options...
0 Radian Posted September 25, 2019 Author Share Posted September 25, 2019 2 hours ago, crazyarashi said: - script item_swap -1,{ for([email protected] = 0; [email protected] < .size; [email protected]++){ [email protected]$ += "List " + ([email protected]+1) + ":"; } mes "Select a list."; next; [email protected] = select([email protected]$) - 1; explode([email protected]$,.item_list$[[email protected]],","); for([email protected] = 0; [email protected] < getarraysize([email protected]$); [email protected]++){ [email protected] = atoi([email protected]$[[email protected]]); [email protected][[email protected]] = [email protected]; if(countitem([email protected])){ [email protected][getarraysize([email protected])] = [email protected]; [email protected]$ += getitemname([email protected]) + ":"; } else { continue; } } mes "Select the item you want to swap."; next; [email protected] = select([email protected]$) - 1; [email protected]_id = [email protected][[email protected]]; [email protected] = inarray([email protected],[email protected]_id); for([email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++){ if([email protected] == [email protected]) continue; [email protected][getarraysize([email protected])] = [email protected][[email protected]]; [email protected]$ += getitemname([email protected][[email protected]]) + ":"; } mes "select the item you want to swap into."; next; [email protected] = select([email protected]$) - 1; delitem [email protected]_id,1; getitem [email protected][[email protected]],1; end; OnInit: setarray .item_list$,"501,502,503,504,505","506,507,508,509,510"; .size = getarraysize(.item_list$); end; } Haven't tested this but pretty sure it will work.. Thank you so much, Working perfectly! Quote Link to comment Share on other sites More sharing options...
0 Ukiram Posted September 25, 2019 Share Posted September 25, 2019 Hi, @Radian how this works? Thanks? Is this commandable? like @swap to swap the equipment? can you explain hehe Quote Link to comment Share on other sites More sharing options...
0 Radian Posted September 25, 2019 Author Share Posted September 25, 2019 On 9/25/2019 at 8:32 AM, DevMarikuLabsan said: Hi, @Radian how this works? Thanks? Is this commandable? like @swap to swap the equipment? can you explain hehe No. It's an npc that allow players to switch from Headgear1 to Headgear2, Headgear3 or Headgear4 @crazyarashi Hi, Where do i need to change if i want to keep the refine + cards of the old headgear into the new headgear? Quote Link to comment Share on other sites More sharing options...
Hey guys, can i request this kind of script? I am having issue on how to start on it.
How it works, is
Thank you so much.
Link to comment
Share on other sites