Jump to content

Does Anyone Have a Working Simple Give Script


Prokofy Neva
 Share

Recommended Posts

The one I have stopped working, I don't know why. I am careful to put the name of the new object within the quotation marks, but it just won't work.


I have GIVE ALL CONTENTS but I don't want customers to get the item, and then every script inside the prim, too, especially if I have HOVER, TALK, etc. scripts.

 

I need a script that reads the agent and just gives them the one named item, which SIMPLE GIVE used to do.

 

Can't find in the library.

Link to comment
Share on other sites

Have you checked that your script isn't trying to give, for example, a notecard and you want it to give an object?  Look for references to INVENTORY_NOTECARD and INVENTORY_OBJECT in the script.    That could be the problem.  Certainly llGiveInventory hasn't changed recently.

 

If all else fails, this should work (assuming the recipient hasn't muted the object or the object's owner) but I don't really see why your old script wouldn't work.

 

string gift = "Name of item here";default{	state_entry()	{		if (llGetInventoryType(gift)==INVENTORY_NONE){			llOwnerSay("Can't find an item called "+gift+" in my inventory.  Please check.");		}	}	changed(integer change)	{		if (change & CHANGED_INVENTORY){			llResetScript();		}	}		touch_start(integer total_number)	{		key av = llDetectedKey(0);		llGiveInventory(av,gift);	}}

 

Link to comment
Share on other sites

That isn't the issue. Here's the script, that used to work if you just changed the word in the quotation marks:

 

string itemName = "Test"; // Replace the word in quotes with the name of the item you want to give.

default
{
    state_entry()
    {
        llInstantMessage(llGetOwner(), "Rice Krispie");
    }

    touch_start(integer total_number)
    {
        llInstantMessage(llDetectedKey(0), "Delivering " + itemName + ".");
        llGiveInventory(llDetectedKey(0), itemName);
    }
}

 

 

Now, even if you reset the script, it keeps giving this error message:

 


Unable to give inventory: 'No item named 'Test'.'.

 

Something has gotten corrupted or no longer works.

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...