Tattooshop Posted July 2, 2020 Share Posted July 2, 2020 (edited) Hello! I'm working on a simple info board menu that allows to any avatar to choose which object / notecard / landmark to receive. How to make that if the chosen item is missing, it does not give an error "Unable to give inventory: 'No item named "" but produce a message in chat like "sorry this item is missing". Edited July 2, 2020 by Tattooshop Link to comment Share on other sites More sharing options...
Mollymews Posted July 2, 2020 Share Posted July 2, 2020 test that the named item exists with llGetInventoryType before trying to give it key thisperson = ... some avatar uuid ... ; string thisthing = "A THING"; if (llGetInventoryType(thisthing) != INVENTORY_NONE) llGiveInventory(thisperson, thisthing); http://wiki.secondlife.com/wiki/LlGetInventoryType 1 Link to comment Share on other sites More sharing options...
Tattooshop Posted July 2, 2020 Author Share Posted July 2, 2020 47 minutes ago, Mollymews said: test that the named item exists with llGetInventoryType before trying to give it key thisperson = ... some avatar uuid ... ; string thisthing = "A THING"; if (llGetInventoryType(thisthing) != INVENTORY_NONE) llGiveInventory(thisperson, thisthing); http://wiki.secondlife.com/wiki/LlGetInventoryType Thank you very much! It works now! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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