Donation Box

Date 2006/10/17 2:10:00 | Topic: Money

I've seen this script in Freebie packs all the time, and it's always wrong. It doesn't correctly show how much has been collected so far. I assume it's because it is an old script and SL may have changed since. Either way, this is my own version, and it works.
integer totaldonated;

default
{
    
on_rezinteger sparam )
    {
        
llResetScript();
    }

    
state_entry()
    {
        
llSetText("Donation Box\nL$0 Donated so far",<1,1,1>,1);
    }

    
money(key idinteger amount)
    {
        
totaldonated totaldonated amount;
        
llSetText("Donation Box\nL$" + (string)totaldonated " Donated so far",<1,1,1>,1);
        
llInstantMessage(id,"Thank you for the donation!");
    }
}




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