Jump to content

Question on how to tweak script to give specific inventory item


Pixels Sideways
 Share

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

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

Recommended Posts

Hola!

I have an object with scripted faces and when the faces are touched do a variety of different things. 

I have two LM's in my object's inventory.  My Home #1  and  My Home #2

When face four is touched, it should give out the LM for My Home #1

When face one is touched, it should give out the inventory LM for My Home #2

This is what I currently have in my script for face one which is a line of generic script command to give  out a LM in the inventory and chat.

        else if (face == 1) {
            string oldName = llGetObjectName();
            llSetObjectName(":");
             llGiveInventory(llDetectedKey(0), llGetInventoryName(INVENTORY_LANDMARK", 0));
            llInstantMessage(llDetectedKey(0), "Check your inventory for your LM to My Home #2");

            llSetObjectName(oldName);
            llSleep(1);

This doesn't work because it will only give the first LM in the inventory which is My Home #1.

How do I have the Give inventory for Landmark items command give a specific LM?

Thank you!

pixels xo

 

 

 

 

Link to comment
Share on other sites

Hey Pixels,

On this line llGiveInventory(llDetectedKey(0), llGetInventoryName(INVENTORY_LANDMARK", 0));, you can replace the by the actual name of the landmark. This would give you 

 

llGiveInventory(llDetectedKey(0), "My Home #2");

 

Otherwise, you can change the parameter 2 of the llGetInventoryName to 1 to give you the second landmark in the inventory of the object.

 

Let me know if it helps!

 

Edited by Luke Rowley
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 2 months later...

I have an object that will contain hundreds of landmarks (LM).  I will have notecards (NC) associated with some of these landmarks. 

I have an algorithm that decides which LM to give to an avatar that touches the object, and that is working, which results in a string that is the name of the landmark.

I then give the LM to the avatar using llGiveInventory(avatar_key, string_inventory_name), which successfully gives the LM to the Avatar.   

I would like to give a NC same name as the LM, and then give both to the avatar.  How do I get llGiveInventory(avatar_key, string_inventory_name) to give the NC also?

llGiveInventory(avatar_key, string_inventory_name) gives one item, and then terminates.

Link to comment
Share on other sites

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