Landmark Giver

Written by Kitsune

 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.90196, 0.72549, 0.35294>, 1.0);
    }

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