Jump to content

Need Scripting a menu object giver!


DominicBasino
 Share

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

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

Recommended Posts

I want to make a script that when touched it gives a person a menu to chose what hey want to recieve from that object. This is what I have so far. Where am I going wrong cause its only giving me one item to chose from:

 

list MENU1 = [];
list MENU2 = [];
integer listener;
integer MENU_CHANNEL = 1000;

default
{
touch_start(integer total_number)
{
if(llGetInventoryNumber(INVENTORY_ALL) > 1)
{
if(llGetInventoryName(INVENTORY_ALL, 0) != llGetScriptName())
{
llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_ALL, 0));
}
else
llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_ALL, 1));
}
else
llInstantMessage(llDetectedKey(0), "There is no item to give away!");
}
}

Link to comment
Share on other sites

It's possible to make objects like that, certainly.    It's just that we have to write the scripts ourselves.    As I suggested in the Answers section, we can show you how to write that kind of script, or you should be able to find one easily enough in one of the script libraries.

Take a look at Zenmondo's object giver (the second listing on the page).   That does pretty much what you want, I think, though it will need some minor alterations to the wording on the menus and suchlike.

Link to comment
Share on other sites

It's really not too difficult to do.  I know it looks horribly complex, but if you break it down into smaller units, it becomes a lot simpler.

The tutorial Roilig recommended, on how to create dialog menus, is very accessable, and it's something you need to know about if you're going to learn to script.

Work through that, so you understand how the basic communication mechanism works, and then we can look at how to build a menu dynamically, from the contents of the prim's inventory, and how to process the reply that you get from the dialog menus.    

Link to comment
Share on other sites

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