MLPV2 Give Folder Add-on

From Second Life Wiki
Jump to navigation Jump to search


<lsl>//This MLP Addon script by Paradisio Adasia is a variant on the original ~give script by Chaz Longstaff. //This script is free to distribute the modify as long as credit to the creators is included. //The usage is similar and both the givefolder variant here and the original one can work in the same item. //Usage: //To use this put it in a menu as appropriate using the following syntax: //LINKMSG buttonname | 1,-4,957789,Item1+Item2+Item3++Foldername //Replace Buttonname with what you want the name in the MLP to use for the button //Replace Foldername with whatever you wish for the folder given to be called //Replace Item1+Item2+Item3 with the exact names of the items. //The + sign is required as it separates the items in the code. //As well the ++ is required as well after the item list and before the foldername to separate them as well. //Contact Paradisio Adasia for any problems or suggestions!

default{ link_message(integer from, integer num, string str, key id) {

      if (num == 957789) {
           list TempList = llParseStringKeepNulls(str,["++"],[]);
           string FolderName = llStringTrim(llList2String(TempList, 1),STRING_TRIM);
           string Objects = llStringTrim(llList2String(TempList, 0),STRING_TRIM);
           list Inventory = llParseStringKeepNulls(Objects,["+"],[]);
           llGiveInventoryList(id, FolderName, Inventory);
       } //end of if for channel
   } //end link_message

} //end default </lsl>