Edie_Shoreland

Avatar Alt Loan Script

Apr 20th, 2019
1,507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //THIS IS A VERY DANGEROUS SCRIPT.  MAKE SURE YOU 100%
  2. //TRUST ANYONE IN THIS SCRIPT'S ALTS LIST.  ONCE YOU
  3. //GIVE PERMISSIONS FOR THIS SCRIPT TO TAKE MONEY, IT
  4. //IS VERY EASY FOR ANYONE IN THE ALTS LIST TO WIPE OUT
  5. //YOUR ACCOUNT WITH A FEW CLICKS.
  6.  
  7. //Modified from the single use transfer example script
  8. //at http://wiki.secondlife.com/wiki/LlGiveMoney
  9.  
  10. //replace the NULL_KEYs with your alts' UUIDs
  11. list alts= ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000"];
  12.  
  13. integer transfer = 50;
  14. integer debitPermission;
  15.  
  16. default
  17. {
  18.     state_entry()
  19.     {
  20.         //THIS GIVES ANYONE IN YOUR ALTS LIST PERMISSION TO
  21.         //TAKE MONEY OUT OF YOUR ACCOUNT.
  22.         llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
  23.     }
  24.  
  25.     run_time_permissions (integer perm)
  26.     {
  27.         if  (perm & PERMISSION_DEBIT) debitPermission = TRUE;
  28.     }
  29.  
  30.     touch_start(integer num_detected)
  31.     {
  32.         //This compares the person touching the prim against your
  33.         //list of alts.
  34.         string convertkey = (string)llDetectedKey(0);
  35.         integer authorized = (~llListFindList(alts, [convertkey]));
  36.  
  37.         //If you haven't given permissions, or the avatar touching
  38.         //the prim is not on the list, nothing happens.
  39.         if (!debitPermission) return;
  40.         if (!authorized) return;
  41.  
  42.         //if both permissions and the alt are approved, the alt
  43.         //receives $50L
  44.         key id = (key)convertkey;
  45.         llGiveMoney(id, transfer);
  46.     }
  47. }
Advertisement