Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer pot;
- integer amount;
- integer total;
- key tid;
- string ownername;
- init()
- {
- ownername = llKey2Name( llGetOwner());
- llSetText( "Tip the DJ",<0,1,0>,1);
- llOwnerSay ( "Tip jar for " + ownername + " ready..." );
- }
- default
- {
- state_entry()
- {
- init();
- }
- on_rez( integer param )
- {
- init();
- }
- touch_start( integer num )
- {
- llInstantMessage( llDetectedKey(0),"Come on - tip the DJ and say thanks for the excellent music");
- }
- money( key id, integer payment )
- {
- amount = payment;
- tid = id;
- llRequestAgentData( id, DATA_NAME );
- }
- dataserver( key query, string name )
- {
- llSay( 0, name + " tips " + ownername + " " + (string)amount + "L");
- llSay( 0, "Thanks " + llGetSubString( name, 0, llSubStringIndex( name, " " )) );
- llInstantMessage( tid, "I really appreciate your tip " + llGetSubString( name, 0, llSubStringIndex( name, " " )));
- // if ( llGetInventoryNumber( INVENTORY_SOUND ) > 0 )
- // {
- // llPlaySound( llGetInventoryName( INVENTORY_SOUND, 0 ),1 );
- // }
- // if ( llGetInventoryNumber( INVENTORY_TEXTURE ) > 0 )
- // {
- // llGiveInventory( tid,llGetInventoryName( INVENTORY_TEXTURE,0 ));
- // }
- float totalobjects = llGetInventoryNumber(INVENTORY_OBJECT); //number of objects
- totalobjects = llFrand(totalobjects); //Total objects
- llGiveInventory(tid,llGetInventoryName(INVENTORY_OBJECT, (integer)totalobjects)); //Give any random object out of the total
- total = total + amount;
- llSetText( "Tips so far : \n" + (string)total +"L" , <llFrand(1),llFrand(1),llFrand(1)>,1 );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement