Skip to content

Instantly share code, notes, and snippets.

@antonyfairport
Created July 20, 2016 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonyfairport/c418eaa23a0d1a70d6a8d5fcb7dda216 to your computer and use it in GitHub Desktop.
Save antonyfairport/c418eaa23a0d1a70d6a8d5fcb7dda216 to your computer and use it in GitHub Desktop.
default
{
state_entry()
{
llAllowInventoryDrop( TRUE );
}
changed( integer change )
{
if ( ( change & CHANGED_INVENTORY ) || ( change & CHANGED_ALLOWED_DROP ) )
{
integer iMax = llGetInventoryNumber( INVENTORY_NOTECARD );
integer i;
for ( i = ( iMax - 1 ); i >= 0; i-- )
{
llRemoveInventory( llGetInventoryName( INVENTORY_NOTECARD, i ) );
}
if ( iMax > 0 )
{
llSay( 0, "Thank you for your notecard!" );
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment