Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Give InventoryDrop

Douglas Callahan
Fresh Prince Of SL
Join date: 2 Jul 2004
Posts: 349
04-17-2005 13:50
Hi,
I want to have people drop a notecard into a box and then the notecard is given to me in my inventory, here's what i have so far:

CODE
default
{
state_entry()
{
llAllowInventoryDrop(TRUE);
}

touch_start(integer total_number)
{

llGiveInventory(llDetectedKey(0), "Notecard Name Here");
}

changed(integer change)
{
if ( change & CHANGED_ALLOWED_DROP )
{
llGiveInventory(llGetOwner(), "" + (string) change + "");
}
}
}


However it doesn't work, any suggestions?
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
04-17-2005 13:57
Try CHANGED_INVENTORY.

Also... "string change?" No no no...

CODE
integer num = llGetInventoryNumber(INVENTORY_NOTECARD);
string name = llGetInventoryName(INVENTORY_NOTECARD,num - 1);
// If needed:
// llRemoveInventory(name);


Oh, and kill the double post. ;)
_____________________
---