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_rez( integer sparam )
{
llResetScript();
}
state_entry()
{
llSetText("Donation Box\nL$0 Donated so far",<1,1,1>,1);
}
money(key id, integer amount)
{
totaldonated = totaldonated + amount;
llSetText("Donation Box\nL$" + (string)totaldonated + " Donated so far",<1,1,1>,1);
llInstantMessage(id,"Thank you for the donation!");
}
}
|