Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

tip jar

Anniella Winx
Virtual addict
Join date: 12 Jan 2007
Posts: 86
08-01-2007 10:10
How do you write a simple tip jar script with some floating text?
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
08-01-2007 12:18
Search is your friend... try it! :D

My guess would be to look up llSetText() and the money() event handler, but that's just my opinion. ;)
Anthalia Nemeth
Registered User
Join date: 8 Mar 2007
Posts: 17
08-01-2007 15:41
You would use a global variable to store the amount of money and then do exactly what Talarus said... so something like this:
CODE

integer TOTAL;
default
{
money(key giver, integer amount)
{
TOTAL = TOTAL + amount;
llSetText("Tip Jar \n Total: " + (string)TOTAL, <0.0, 1.0, 0.0>, 1.0);
}
}

oh the \n will make the Total appear on the next line under "Tip Jar" and (string) typecasts the integer value of TOTAL as a string. The <0.0, 1.0, 0.0> is the color of the text and the 1.0 is the alpha level.