Landmark Giver

Date 2006/12/15 7:02:56 | Topic: Agent/Avatar

I made the following script for my store. It tells the Owner how many Landmarks have been given away when the owner Touches the object.
(It will not give the owner a Landmark, 'cause that would get annoying everytime you checked the tally.)
integer given;

default
{
    
on_rez(integer start_param)
    {
        
llResetScript();
    }
    
    
state_entry()
    {
        
given 0;
        
llOwnerSay("Be sure to only have one landmark in the inventory.");
        
llOwnerSay("Touch at any time to see how many Landmarks have been given away!");
        
llSetText("Touch for a Landmark", <0.901960.725490.35294>, 1.0);
    }

    
touch_start(integer total_number)
    {
        if ( 
llDetectedKey(0) != llGetOwner() )
        {
            
given given 1;
            
llGiveInventory(llDetectedKey(0), llGetInventoryName(INVENTORY_LANDMARK0));
        }
        else if ( 
llDetectedKey(0) == llGetOwner() )
        {
            
llOwnerSay((string)given " landmarks have been given away since this object was rezzed.");
        }
    }
}




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=10