Jump to content

touch to get


DelizaLove
 Share

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

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

Recommended Posts

I found some code where I can touch to get the content, but Im putting it into a new prim where I want them to touch to get a notecard and a landmark. When I click it the menu comes up with "object". No details what it is.

How can I fix that ?

 

Code used is this

list gInventoryList;

list getInventoryList()
{
integer i;
integer n = llGetInventoryNumber(INVENTORY_ALL);
list result = [];

for( i = 0; i < n; i++ )
{
result += [ llGetInventoryName(INVENTORY_ALL, i) ];
}
return result;
}

default
{
state_entry()
{
gInventoryList = getInventoryList();
}

touch_start( integer n )
{

integer i;

for( i = 0; i < n; i++ )
{
llGiveInventoryList(llDetectedKey(i), llGetObjectName(), gInventoryList );

}
}

changed( integer change )
{
if ( change == CHANGED_INVENTORY )
gInventoryList = getInventoryList();
}
}

 

Link to comment
Share on other sites

Your menu gives the person who touches the vendor a folder that contains a copy of everything in the vendor's contents, including a copy of this script.  The folder has the same name as the vendor that has this script in it.  I assume that name is "Object".  If you want it to have a different name, either rename your vendor or modify the script.

Link to comment
Share on other sites

In your user defined function at the top of the script, modify the loop that loads the list by adding a filter to exclude the script...

for( i = 0; i < n; i++ ){    if (llGetInventoryName(INVENTORY_ALL,i) != llGetScriptName()) //Add this bit    { // And this bracket        result += [ llGetInventoryName(INVENTORY_ALL, i) ];    } // And don't forget this one}

 Now would be a good time to start working through some LSL tutorials ......  :smileywink:

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3411 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...