Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Script needed for giving free items away

Klaus Fassbinder
The Thinker
Join date: 2 Feb 2005
Posts: 4
03-20-2005 02:48
After more then a week of searching, testing and finally pulling My hair out, which is not easy with a crew cut, I could use help from a scripter or a kind hearted soul who may already have a script.

I would like to have a script where one touchs an object it will give all the contents of that object (free clothing for example) to the user who touched it by creating a folder in their inventory with the items within that folder.

Any help given would be greatly appreciated. Will pay L$ for the script.

Thank you,

Klaus,
Fassbinder Castle
Sorin Rubio
Registered User
Join date: 26 Mar 2004
Posts: 8
03-20-2005 03:44
CODE
touch_start(integer t) 
{

list inventory = [];
list INVENTORY_CONSTANTS = [INVENTORY_TEXTURE, INVENTORY_SOUND,
INVENTORY_OBJECT, INVENTORY_SCRIPT, INVENTORY_LANDMARK,
INVENTORY_CLOTHING, INVENTORY_NOTECARD, INVENTORY_BODYPART,
INVENTORY_ANIMATION];
integer i;
integer j;
integer len = llGetListLength(INVENTORY_CONSTANTS);
for (i = 0; i < len; i++) {
integer constant = (integer) llList2String(INVENTORY_CONSTANTS, i);
integer num = llGetInventoryNumber(constant);
for (j = 0; j < num; j++) {
string name = llGetInventoryName(constant, j);
if (name != llGetScriptName()) // Let's not give this script away while giving inventory contents
{
inventory += name;
}
}
}
string folderName = "Name of folder"; //Change this to change the name of the folder
llGiveInventoryList(llDetectedKey(0), folderName, inventory); // Give the user the contents of the object.
}