Advertisement
LethBaumann

Group Only Vendor

Sep 2nd, 2018
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    integer price = 250; // cost of item
  2.    string object = "NameOfObject"; // Name of object being sold.
  3.    
  4.    default
  5.    {
  6.      state_entry()
  7.      {
  8.           llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
  9.      }
  10.    
  11.      run_time_permissions(integer p)
  12.      {
  13.           if( p & PERMISSION_DEBIT)
  14.           {
  15.                llSetObjectDesc(object + " costs " + (string)price + "L$. Right-click and select 'pay' to purchace");
  16.                llSetPayPrice(PAY_HIDE, [price, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
  17.           }
  18.           else
  19.           {
  20.                state suspend;
  21.           }
  22.      }
  23.    
  24.      money(key id, integer amt)
  25.      {
  26.           if(amt != price || !llSameGroup(id))
  27.           {
  28.                llGiveMoney(id, amt);
  29.                if(!llSameGroup(id)) llWhisper(0, "Remeber to be wearing your group tags!");
  30.                if(amt != price) llWhisper(0, "Price is: " + (string)price + "L$.");
  31.           }
  32.           else
  33.           {
  34.                llGiveInventory(id, object);
  35.                llWhisper(0, "Thanks for buying!");
  36.           }
  37.      }
  38.    
  39.          touch_start(integer n)
  40.          {
  41.               if(llDetectedKey(0) == llGetOwner())
  42.              {
  43.                  llResetScript();
  44.              }
  45.              else
  46.              {
  47.                  llWhisper(0, object + " costs " + (string)price + "L$.");
  48.                  if(!llDetectedGroup(0)) llWhisper(0, "Only available to our group. Wear your group tag to purchace.");
  49.              }
  50.          }
  51.  
  52.      on_rez(integer z)
  53.      {
  54.          llResetScript();
  55.      }
  56.    }
  57.    
  58.    state suspend
  59.    {
  60.      state_entry()
  61.      {
  62.          llSetObjectDesc("Vendor Suspended.");
  63.      }
  64.  
  65.      touch_start(integer n)
  66.      {
  67.           if(llDetectedKey(0) == llGetOwner()) llResetScript();
  68.      }
  69.  
  70.      on_rez(integer z)
  71.      {
  72.          llResetScript();
  73.      }
  74.    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement