Gives a folder of items only to avatars with the same active group.
// Add this script and your items to an object.
// When Touched a folder of all items inside the object will be given.
// Scripts are the only inventory type that will not be given, (including this script.)
// Avatars must have the same group active as object to get folder.
default
{
state_entry()
{
llSetText("Touch for a Folder", <1,1,1>, 1.0);
}
touch_start(integer total_number)
{
integer i;
for (i=0;i<total_number;i++)
{
if(llSameGroup(llDetectedKey(i)))
{
key target = llDetectedKey(i);
list inv;
integer i;
integer max = llGetInventoryNumber(INVENTORY_ALL);
for (i=0; i<max; ++i)
{
if (llGetInventoryType(llGetInventoryName(INVENTORY_ALL, i)) != INVENTORY_SCRIPT)
{
inv += [llGetInventoryName(INVENTORY_ALL, i)];
}
}
llGiveInventoryList(target, llGetObjectName(), inv);
}
else
{
llWhisper(0, "Group tag must be worn to receive folder.");
}
}
}
}
|