Give Random Object

Date 2008/4/1 8:15:05 | Topic: Agent/Avatar

Fill a prim with this script and as many objects as you like. User Touches and gets 1 random object. (No more than 100 objects is suggested for best results.)

default
{
    
touch_start(integer total_number)
    {
        
float totalobjects llGetInventoryNumber(INVENTORY_OBJECT);
        
totalobjects llFrand(totalobjects);
        
llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_OBJECT, (integer)totalobjects));
    }
}




This script comes from Alicia Stella Design - Best Tip Jars in Second Life
http://www.aliciastella.com

The URL for this script is:
http://www.aliciastella.com/modules/AMS/article.php?storyid=16