|
stefanus Hebert
Registered User
Join date: 16 Sep 2005
Posts: 18
|
01-21-2007 11:56
Folks,
A quick one:
Looking for a script that will dispense a notecard when someone "buy" an item.. (not touch) but the right click "buy"
Reason is that some items are sold as original and people forget to"take" them after buying. So having a note poping up right after they buy would be great!
thanks folks Stefanus
|
|
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
|
01-21-2007 12:58
I need to ask a followup. when you say "BUY" an item... are they buying the actual item? or a copy of it (or it's contents). if you are using the buy function to just "change ownership" of a single entity in world (not talking a box vendor here) then yes.. there may be a way. This was from Deanna Trollop's post on a very similar question recently. Apparrently, when you "buy" an object (transfer ownership of a given rezzed construct), it will trigger the "changed" event. Apparrently the Owner being changed is a detectable event.. so long as the item is rezzed before during, and after the transfer of ownership. (this isn't going to work on a Box vendor set to sell contents) I'm looking for the exact post that she made, referencing this. Ah.. here we are! /54/38/161394/1.html#post1388203From: Deanna Trollop When you buy an existing, rezzed object, it's changed event is called, with the CHANGED_OWNER bitflag included in the bitfield parameter. Please note the details section on the CHANGED_OWNER event on the first wiki page linked above... apparently this event will be called in the original object when buying a copy. So, basically: default { changed( integer change ) { if( change & CHANGED_OWNER ) { // code here will be executed after purchase } } }
At that point, you just need to tinker a bit.. look up llGiveInventory to figure out how to deliver a notecard to the new owner... should be pretty straightforward from there. if ya need more.. holler. 
_____________________
 ● Inworld Store: http://slurl.eclectic-randomness.com ● Website: http://www.eclectic-randomness.com ● Twitter: @WinterVentura
|