Advertisement
Guest User

tipjar

a guest
Jul 18th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. //FREE SCRIPTS - TESTED AND WORKING ON KITELY
  2.  
  3.  
  4. // If you paid for this script, you were ripped off.
  5. // You may use in your creations.
  6. // You may not sell it as a script or in a script collection.
  7.  
  8. //Copy and paste the contents of this notecard into a new script.
  9.  
  10.  
  11. //The message to give the person that has paid a tip
  12. string gMessage = "Thank you for your tip, It is appreciated!";
  13.  
  14. //This is a recommendation which will be the set amount in the pay box
  15. integer gRecommendedTip = 50;
  16.  
  17. //The color of the hover text
  18. vector gColor = <1,1,1>;
  19.  
  20. //Show name of tipper? 'yes' or 'no'
  21. string gShowSwitch = "yes";
  22.  
  23. //Notify you when someone has tipped? 'yes' or 'no'
  24. string gNotifySwitch = "yes";
  25.  
  26.  
  27. //_______________Do not edit below here____________
  28.  
  29. integer gTotal = 0;
  30.  
  31. default
  32. {
  33. state_entry()
  34. {
  35. llSetText("", <1,1,1>, 1);
  36. llSetClickAction(CLICK_ACTION_PAY);
  37.  
  38. llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
  39. }
  40.  
  41. run_time_permissions(integer perms)
  42. {
  43. if(perms)
  44. {
  45. llSetPayPrice(gRecommendedTip, [100, 150, 200, 250]);
  46. }
  47. }
  48.  
  49. money(key customer, integer amount)
  50. {
  51. string CustomerName = llKey2Name(customer);
  52. integer Last = amount;
  53. gTotal += amount;
  54. string Prefix = "";
  55.  
  56. if(llToLower(gShowSwitch) == "yes")
  57. Prefix = "Last Tipper: "+CustomerName+"\n";
  58.  
  59. llSetText(Prefix+"Last Tip: $L "+(string)Last+"\nTotal: $L "+(string)gTotal,gColor, 1); // Change this to your Grid's Currency type
  60.  
  61. llInstantMessage(customer, gMessage);
  62.  
  63. if(llToLower(gNotifySwitch) == "yes")
  64. llInstantMessage(llGetOwner(), CustomerName+" has just made a donation of $L "+(string)amount+"."); // Change this to your Grid's Currency type
  65.  
  66.  
  67. }
  68.  
  69. on_rez(integer start_param)
  70. {
  71. llResetScript();
  72. }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement