Random Object Giver Script

Written by: Headmaster
/We're saving the keys to be sure people can only touch once. 
//To avoid running out of memory, the list must be cleared occassionally or at least trimmed. 
//This is accomplished, in this script, by resetting after set period of time


integer reset_list=86400;//reset list after one day (in seconds)
list touched;
default{
touch_start(integer total_number){
key id = llDetectedKey(0);
if(llListFindList(touched,[id])==-1){
touched+=[id];
llGiveInventory(id,llGetInventoryName(INVENTORY_OBJECT,(integer)llFrand(llGetInventoryNumber(INVENTORY_OBJECT))));
}
if(llGetTime()>=reset_list){llResetScript();}//clear list | restart script time 
}
}