|
Tuli Asturias
=(^x^)=
Join date: 26 Oct 2005
Posts: 90
|
05-17-2006 14:44
I know nothing of scripting I'm afraid, so i'm asking you guys. I am looking for a script that lets contents of an object be bought a limited number of times. Anyone?
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
05-17-2006 14:50
I *think* you can set the object to give away to no-copy and put as many in the dispenser as you want to give. Then, since it cannot copy, each one given is removed from the inventory until none are left.
I've not tried this, but I base it on the wiki for llGiveInventory,
Q: When I try to give an inventory item to an agent, the item disappears from the original object's inventory. What's going on? A: This is happening because you don't have copy permission on the item you're trying to give. Consequently, the script gives the only copy of the item in your object. To determine whether or not you have permission to give the objects specified, use llGetInventoryPermMask.
Hope this helps, Baron
|
|
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
|
05-17-2006 14:55
There's no way to do so using the default "Buy Object Contents", but using a pay system, it might be possible.
Perhaps having a key containing keys and the number of buys, e.g. "<nbuys1><key1><nbuys2><key2>", etc. "06f1f2d29a-210b-4b00-96d7-ab16c962a40f" Would mean the the avatar with that key had bought the object six times. The object would remove the beginning of this string when it grows past a certain point, to prevent stack/heap collisions.
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
05-17-2006 22:08
Actually if the names aren't critical (so foo, foo 1, foo 2 etc.) are acceptable... and the items are otherwise identical there's no need to store the data.
You put in the right number of "copies" and use llGiveInventory, then llRemoveInventory so you sell one and kill it from the inventory.
Doing it for multiples of different sorts of items can be jiggered to work the same way too.
|
|
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
|
05-17-2006 23:04
You could just put a counter in the money event, when someone actually recieves the item you increment the counter, after x increments, you turn off the system.
|