john_danger

trying to forward money to friend with tip float text help

Dec 22nd, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ///TRYING TO MAKE A SCRIPT THAT WILL  HAVE FLOAT TEXT WITH DONATIONS THAT WILL PASS THE  MONEY TO SIM OWNER AS DONATION I have to declare these global variables at the top of the script so i can refer to them anywhere in it
  2.  
  3. key friend = "e80e7fee-95e0-474a-a700-1029696d72fc"; // Mayfield1950's  -- you might want to alter this
  4.  
  5. string friend_name;  // because of the way lsl works, i have to get the name in the script itself
  6. default
  7. {
  8.     state_entry()
  9.     {
  10.         llRequestPermissions(llGetOwner(), PERMISSION_DEBIT); // ask for permission to debit the owner's account -- needed to pay money to someone else
  11.         llRequestAgentData(friend, DATA_NAME); // get friend's name
  12.         llSetPayPrice (PAY_DEFAULT,[50, 100, 250, 500]); // put in some suggested amounts      
  13.     }
  14.  
  15.      dataserver(key queryid, string data)
  16.  
  17.     {
  18.         friend_name = data;  // fill in the value for the friend_name variable
  19.         llOwnerSay("going to pass donation to "+friend_name);  //make sure we've got this right
  20.     }
  21.    
  22.     money(key giver, integer amount)
  23.     {
  24.          total += amount;
  25.          
  26.         llSetText("Mayfield Sim " + " L$ " + (string)total + "\nLast donation: L$ " + (string)amt + "\nby " + llKey2Name(id), <1,1,1>, 1);  
  27.  
  28. llSay(0, "Thank you , "+llKey2Name(giver)+ ", for your support of L$"+(string)amount+",  which is being forwarded to "+friend_name+" right now");
  29.  
  30.         llGiveMoney(friend, amount); // give the amount I've just been given to my friend
  31.     }
  32.    
  33.     changed(integer change){
  34.        
  35.         if(change&CHANGED_OWNER){
  36.             llResetScript();
  37.         }
  38.     }
  39. }
Add Comment
Please, Sign In to add comment