Hello there I have developed a basic give inventory script with a loading bar when touched to unpack the items, if some one could play around with it to make it look more professional and better timing with special effects, such as when the box disappears a light beam flash of some sort. Bascically if you could just play around with it and develop it even further I would gladly appreciate it. Script as follows:
list gInventoryList;
integer a;
string hovertext="Touch To Unpack";
list getInventoryList()
{
integer i;
integer j;
integer n = llGetInventoryNumber(INVENTORY_ALL);
list result = [];
string msg = "";
for( i = 0; i < n; i++ ) {
if (llGetInventoryName(INVENTORY_ALL, i) != llGetScriptName()) {
result += [ llGetInventoryName(INVENTORY_ALL, i) ];
}
}
return result;
}
default
{
on_rez(integer p)
{
gInventoryList = getInventoryList();
}
state_entry()
{
llSetText(hovertext, <1,1,1>, 1);
gInventoryList = getInventoryList();
}
touch_start( integer n )
{
integer len = llGetListLength(gInventoryList);
// If we have nothing to give, or the owner didn't touch us, do nothing.
if (len == 0 || llDetectedKey(0) != llGetOwner())
return;
if (len == 1) {
// If there's only one item, hand it off directly
llGiveInventory(llDetectedKey(0), llList2String(gInventoryList, 0));
} else {
// If there are multiple items, give them in a tidy folder
llGiveInventoryList(llDetectedKey(0), llGetObjectName(), gInventoryList);
}
// Kill the box once inventory is delivered.
string load_string="";
string start_string="Unpacking\n["; string end_string="]";
for (a=0; a < 10; ++a) { load_string = load_string + "|";
llSetText(start_string+load_string+end_string,<0,0.75,0>,1);
llSleep(0.2);
}
llSleep(1);
llSleep(1.0);
llDie();
}
changed( integer change )
{
if ( change & CHANGED_INVENTORY || change & CHANGED_ALLOWED_DROP)
gInventoryList = getInventoryList();
}
}
Kind Regards
Jacen Cazenove