kawolf Posted August 4, 2019 Share Posted August 4, 2019 Hi all, am having a problem with the following script it detects the name of the avi and says it ok. but at the give object part even tho its said the name above it still gives error message llGiveInventory: Can't parse destination key 'avi name' I've also tried it using id2=Detectedkey(0) any help would be appreciated integer score; integer CHANNEL = -1234567890; string id2; default { touch_start(integer num_detected) { id2=llDetectedName(0); llSay(0,id2);//say name of avi using this line to check it worked score = 0; llListen(CHANNEL,"", NULL_KEY, ""); } listen(integer CHANNEL, string name, key id, string message) //lISTENS TO A DIFFERENT SCRIPT HERE { if ( message == "hit") { score=score+1; } if (score == 5) { llSay(0,"THATS THE LOT"); integer randomIndex = llGetInventoryNumber(INVENTORY_OBJECT); // random >> [0.0, max) randomIndex = (integer)llFrand(randomIndex); string itemName = llGetInventoryName(INVENTORY_OBJECT, randomIndex); llSay(0, id2);even tho its said the name above llGiveInventory(id2, itemName);//it still gives error message llGiveInventory: Can't parse destination key 'avi name' here llSay(0,"Giving"); } }} //END Link to comment Share on other sites More sharing options...
Mollymews Posted August 4, 2019 Share Posted August 4, 2019 be better off to set id2 as a key type rather than a string type, as llGiveInventory requires a key key id2; id2 = llGetDetectedKey(0); llSay(0, llKey2Name(id2)); llGiveInventory(id2, itemName); http://wiki.secondlife.com/wiki/LlGiveInventory 1 Link to comment Share on other sites More sharing options...
kawolf Posted August 4, 2019 Author Share Posted August 4, 2019 Mollymews. Thanks molly that did the trick 😃 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