Jump to content

Question on how to tweak script to give specific inventory item


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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...