Jump to content
Sunbleached

Sell object to group members / Script

Recommended Posts

Short answer: You can't.

Slightly longer answer: After receiving money, you must check if that person is in the specific group(s) you want. If they aren't, refund them. Else send them a folder.

  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
Share on other sites
Posted (edited)
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...