25 August 2013
11 April 2013
17 March 2012
02 December 2011
23 November 2011
I have seen a number of commercial givers out there on the marketplace and wanted to implement a free one. What is does is offer a menu on touch with forward and backward browsing capabilities and lists the items contained in the same prim as the script resides in. When a user clicks a button, named after the object in the prim, the script gives a copy of that object to the user.
This script has multiple applications depending on what you want to use it for; for example, a simple application would be an automated bartender that people can click to browse and get a drink. Another example would be landmark and notecard givers.
One limitation is that the objects within the prim should have names smaller in length than 24 bytes. Also, please bear in mind that the menu buttons are generated from the inventory contents of the prim, so if your object has a long name, it will be truncated when it appears on the button. A simple way to avoid this is to give simple and meaningful names to the items in the giver prim. In case you want to add items or remove items, just reset the script after you have done your adjustments: I could have included an event handler to trigger when the inventory changes but I preferred to keep things simple.
To use the script, create a prim and add objects, notecards, or whatever you want people to be able to get from the prim. After that, drop this script in the prim. You can configure the script easily, here are some pointers for some cosmetic changes you might want to make to the script:
⟵ Back
and Next ⟶
respectively. If you want to change those to something more fancy, just replace every instance of ⟵ Back
and Next ⟶
with your desired text."Please browse the available items:\n"
. Again, if you wish to enter your own text, just replace every instance of "Please browse the available items:\n"
with what you want the dialog to say.llDetectedKey(0)
with llGetOwner()
.