User:Toady Nakamura/Give to Group

From Second Life Wiki
< User:Toady Nakamura
Revision as of 11:18, 12 April 2016 by Toady Nakamura (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Put this script into a prim along with

Give Only to Group

default
{
    touch_start(integer num) // touch start records toucher "number"
    {
 
        integer touches = 0; // start at zero
 
        do
        {
            if (llDetectedGroup(touches)) // if the toucher is same group as box is set
            {
                llGiveInventory(llDetectedKey(touches), llGetInventoryName(INVENTORY_OBJECT,0));
                  // give the object in inventory to the toucher
            }
            else  // otherwise
            {
                llWhisper(0, "Please set your tag to the correct group for this box."); 
                  // inform toucher they have the wrong tag on
            }
        }
 
        while(num > ++touches);
    }
}

I got this script from a box of Free Scripts at NCI (New Citizens Inc.) in 2009.

  • Visit my SL wiki home page for more simple scripts that work. -- Toady Nakamura