Jump to content

Sell object to group members / Script


Sunbleached
 Share

You are about to reply to a thread that has been inactive for 1696 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Slightly more wordy answer ..... You can't do it directly because you won't be able to check group membership until after the potential buyer has clicked to pay your vendor object.  You can do it in two steps, though.  One way is to follow Wulfie's advice and refund the payment if it turns out that the buyer isn't a group member.  The other way is to write your script with two states.  Use a touch_start event in state default to check whether the person is a group member.  If so, then change to your second state.  In that state, set CLICK_ACTION_PAY in state_entry and tell the buyer to click to buy the product ("Welcome, group member!  Please click to buy my lovely product!").  Use the money event as usual to handle the purchase, and then llSetClickAction(CLICK_ACTION_TOUCH) and return to state default.

I prefer the second method because it doesn't involve refunding any L$, which can be potentially troublesome.  The downside is that it requires a buyer to click your vendor twice, but if you give her clear instructions that shouldn't be a big deal.

Edited by Rolig Loon
  • Thanks 1
Link to comment
Share on other sites

4 minutes ago, Rolig Loon said:

Slightly more wordy answer ..... You can't do it directly because you won't be able to check group membership until after the potential buyer has clicked to pay your vendor object.  You can do it in two steps, though.  One way is to follow Wulfie's advice and refund the payment if it turns out that the buyer isn't a group member.  The other way is to write your script with two states.  Use a touch_start event in state default to check whether the person is a group member.  If so, then change to your second state.  In that state, set CLICK_ACTION_PAY in state_entry and tell the buyer to click to buy the product ("Welcome, group member!  Please click to buy my lovely product!").  Use the money event as usual to handle the purchase, and then llSetClickAction(CLICK_ACTION_TOUCH) and return to state default.

I prefer the second method because it doesn't involve refunding any L$, which can be potentially troublesome.  The downside is that it requires a buyer to click your vendor twice, but if you give her clear instructions that shouldn't be a big deal.

I was also going to suggest enabling/disabling the option to pay, but, during the period that payment is possible, you can't guarantee that the person who paid the object is the person who enabled that state or that they're in the intended group. I'm sure this is nit-picky, but in some cases it might be important (for example if the group is private or pay to join).

Edited by Wulfie Reanimator
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

6 minutes ago, Wulfie Reanimator said:

I was also going to suggest enabling/disabling the option to pay, but, during the period that payment is possible, you can't guarantee that the person who paid the object is the person who enabled that state or that they're in the intended group. I'm sure this is nit-picky, but in some cases it might be important (for example if the group is private or pay to join).

That's a good point.  For that reason, I suggest being sure that the second event has a short time-out so that it can't be left in that state unattended.  You can also take other steps like being sure that the vendor can't be activated from more than 3 meters away.  Any way you do it involves some risk, you're right.  The question is how much risk you are willing to tolerate.  The ultimate best way to guarantee that only group members can buy stuff is to put your vendor on a group-owned parcel and then block non-group members from going there.

  • Thanks 1
Link to comment
Share on other sites

Paying back unintended vectors risks loss of money. I won't go into details. It's something that should be handled by a person after investigation, not a script.

An agent specific pay option has been needed for years to curb abuse and fraud.

Sadly, I don't see us getting it or any usable script feature for some time.

  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1696 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...