Blaze's Tip Jar

integer totaldonated;
string owner;

default
{
    on_rez( integer sparam )
    {
        llResetScript();
    }
    state_entry()
    {
        owner = llKey2Name( llGetOwner() );
        llSetText( owner + "'s Tip Jar.\nFuzion Technologies \n$L0 Donated so far",<.25,1,.65>,1);
    }

    money(key id, integer amount)
    {
        totaldonated += amount;
        llSetText( owner + "'s Tip Jar.\nFuzion Technologies;)\n$L" + (string)amount + " Was donated last!\n" + "$L" + (string)totaldonated + " Donated so far",<.25,1,.65>,1);
        llInstantMessage(id,"Thanks for the donation!");
        llInstantMessage(llGetOwner(),(string)llKey2Name(id)+" donated $" + (string)amount);
    }
}