Advertisement
Guest User

tipjar

a guest
Jul 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. string gMessage = "Thank you for your tip, It is appreciated!";
  2. integer gRecommendedTip = 50;
  3. vector gColor = <1,1,1>;
  4. string gShowSwitch = "yes";
  5. string gNotifySwitch = "yes";
  6.  
  7.  
  8. //_______________Do not edit below here____________
  9.  
  10. integer gTotal = 0;
  11.  
  12. default
  13. {
  14. state_entry()
  15. {
  16. llSetText("", <1,1,1>, 1);
  17. llSetClickAction(CLICK_ACTION_PAY);
  18.  
  19. llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
  20. }
  21.  
  22. run_time_permissions(integer perms)
  23. {
  24. if(perms)
  25. {
  26. llSetPayPrice(gRecommendedTip, [100, 150, 200, 250]);
  27. }
  28. }
  29.  
  30. money(key customer, integer amount)
  31. {
  32. string CustomerName = llKey2Name(customer);
  33. integer Last = amount;
  34. gTotal += amount;
  35. string Prefix = "";
  36.  
  37. if(llToLower(gShowSwitch) == "yes")
  38. Prefix = "Last Tipper: "+CustomerName+"\n";
  39.  
  40. llSetText(Prefix+"Last Tip: $L "+(string)Last+"\nTotal: $L "+(string)gTotal,gColor, 1); // Change this to your Grid's Currency type
  41.  
  42. llInstantMessage(customer, gMessage);
  43.  
  44. if(llToLower(gNotifySwitch) == "yes")
  45. llInstantMessage(llGetOwner(), CustomerName+" has just made a donation of $L "+(string)amount+"."); // Change this to your Grid's Currency type
  46.  
  47.  
  48. }
  49.  
  50. on_rez(integer start_param)
  51. {
  52. llResetScript();
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement