Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Give Contents to Owner Only

Cypher Ragu
[Mad Scientist]
Join date: 6 Jul 2008
Posts: 174
08-22-2008 11:56
Hello, could anyone give me a script that gives the item's inventory to JUST the owner? Or maybe tell me how to make one? Thanks in advance.
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
08-22-2008 12:20
Warning: llGiveInventoryList can only give items which the object owner has copy permission on. If you are selling no-copy items, then you'll need to use a different (and more spammy) method. At that point, I suggest just setting your box to "left click = open" as the default action.

It is also possible to give this script TOO MANY OBJECTS to handle effectively. I have a much more complex version that will deliver several folder, of say 50 items each.. to keep from running out of memory in the item list. If this same script were compiled in mono, it would probably be able to handle a great many more inventory items before running out of memory.


CODE


default
{
touch(integer numdetected)
{
if (llDetectedKey(0) != llGetOwner()) return;
integer i;
list items;
for (i = 0; i < llGetInventoryNumber(INVENTORY_ALL); i++)
{
if (llGetInventoryName(INVENTORY_ALL, i) != llGetScriptName())
{
items = (items = []) + items + llGetInventoryName(INVENTORY_ALL, i);
}
if (llGetListLength(items) > 0) llGiveInventoryList(llGetOwner(), llGetObjectName() + " [f]", items);
else llSay(0, "nothing to give, sorry");
}
}
}

_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Cypher Ragu
[Mad Scientist]
Join date: 6 Jul 2008
Posts: 174
08-22-2008 13:30
Thanks, it works great :D