Give Inventory Contents By Password

Thread Started By ☠ MosDef ☠

2194
0
  • 52 Vote(s) - 3.21 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rate Thread
#1
Code:
/*
Bornslippy Ruby presents...
Give Inventory Contents By Password
Tags: avatar, chat, communications, detection, effects, inventory, owner, primitive, scripts, text, touch, featured, tools
Description:
License:

http://secondlife.coolminds.org
*/

string name = "Package";
integer type = INVENTORY_ALL; // INVENTORY_NOTECARD, INVENTORY_LANDMARK, INVENTORY_OBJECT, ETC, ETC
string password = "porcamadona";

integer channel = 30;
integer pchannel = 31;

//-------------------------------------------

default
{
    state_entry()
    {
        llSetObjectName( name + " Distributor" );
        llSetObjectDesc( "Geezmo Distributor v0.1" );
        llSetText( "Touch me to get\n" + name, <1.0, 1.0, 1.0>, 1.0 );
        llListen( channel, "", "", "" );
        llListen( pchannel, "", llGetOwner(), "" );
    }

    touch_start(integer total_number)
    {
        if ( llDetectedKey( 0 ) == llGetOwner() )
        {
            llOwnerSay( "\nThe current password is: " + password +
                          "\nIf you wanna change it, you have to type on channel " +
                          (string)pchannel + " the new password." );
        } else {
            llWhisper( 0, "You must type the right password on channel " +
                          (string)channel + " in order to get the package box." );
        }
    }
    
    listen( integer _c, string _n, key _i, string _m )
    {
        if ( _c == channel )
        {
            if ( _m == password )
            {
                list content;
                integer i;
                for ( ; i<llGetInventoryNumber(type); ++i )
                {
                    if ( llGetInventoryName( type, i ) != llGetScriptName() )
                        content += llGetInventoryName( type, i );
                }
                
                llGiveInventoryList(_i, name, content);
            }
        }
        
        if ( _c == pchannel )
        {
            password = _m;
            llOwnerSay( "The new password is: " + password );
        }
    }
}
[Image: 8cWHDmW.png]
Reply




Possibly Related Threads…
Thread Author Replies Views Last Post
  Give to Child Prims deadpool 0 2,144 02-19-2013, 02:28 AM
Last Post: deadpool

Forum Jump:

1 Guest(s)
Share this:

About Second Life Copybot

Second Life CopyBot Forum is a place where you can get items for Second Life and other vitual worlds for free. With our CopyBot viewers you can export and import any content from these virtual worlds and modify them in 3D software such as Blender, 3D studio Macx etc...