sndbad Ghost Posted May 10, 2016 Share Posted May 10, 2016 hello there ,my problem when i want Detected key UUID avatarso when i click on the object its work fine ,but when i pay dosnt work object says: Object: 00000000-0000-0000-0000-000000000000 = 00000000-0000-0000-0000-000000000000anyy idea for fix that ? thanks default { on_rez(integer i) { llResetScript(); } state_entry() { } touch_start(integer total_number) { integer i = 0; for (; i < total_number; ++i) { llSay(0, llDetectedName(i) + " = " + (string)llDetectedKey(i)); } } money(key id, integer amount) { integer i = 0; for (; i < amount; ++i) { llSay(0, llDetectedName(i) + " = " + (string)llDetectedKey(i)); } } } Link to comment Share on other sites More sharing options...
Nova Convair Posted May 10, 2016 Share Posted May 10, 2016 There is no fix. llDetectedXXXX functions work in touch and sensor events - nowhere else. The "amount" variable in your money event contains the number of lindens that was payed to your object. So think about your loop and why it makes no sense. From your script I have no clue what you try to do. Maybe tell what you want to do? 1 Link to comment Share on other sites More sharing options...
Qie Niangao Posted May 10, 2016 Share Posted May 10, 2016 As the wiki says: llDetected* functions only work if called from within Detection events (collision, collision_start, collision_end, sensor, touch, touch_start,touch_end) or in functions called by Detection events. They will fail silently and return unusable values if called during other events. not in the money() event. But money() is even easier: it passes in the "id" variable, which is presumably what you wanted with llDetectedKey(). And under most circumstances where a money() event is generated, llKey2Name() of that key should give what you'd have gotten with llDetectedName() 1 Link to comment Share on other sites More sharing options...
sndbad Ghost Posted May 10, 2016 Author Share Posted May 10, 2016 thank you for answering, i want make a gift for last payer when owner click on the Dialog button the script give object for last payer Link to comment Share on other sites More sharing options...
Nova Convair Posted May 11, 2016 Share Posted May 11, 2016 I see. Then you need a global variable (at top of the script) In the money event you store the payer's id in the global variable. In the touch event you give the gift to the last payer and reset the variable.Of course - only if the owner touches it must give a gift and not on everyones touch. So you need something like this: key lastpayer = NULL_KEY;string lastpayername;default{ touch_start(integer total_number) { if (llDetectedKey == llGetOwner()) { if (lastpayer) { llOwnerSay("Lastpayer: " + lastpayername + " = " + lastpayer); // now give the gift to lastpayer lastpayer = NULL_KEY; } else { llOwnerSay("No new payer"); } } } money(key id, integer amount) { lastpayer = id; lastpayername = llKey2Name(id); // llKey2Name only works if the payer is still around // if that is a problem you need to use llRequestAgentData // and a dataserver event } on_rez(integer i) { llResetScript(); } } Link to comment Share on other sites More sharing options...
sndbad Ghost Posted May 11, 2016 Author Share Posted May 11, 2016 thank you for scripting.. but does not work :smileysad: Link to comment Share on other sites More sharing options...
Nova Convair Posted May 11, 2016 Share Posted May 11, 2016 Well, thats no script delivery service. You was supposed to find the typos and bugs by yourself of course it's: if (llDetectedKey(0) == llGetOwner()) { and llOwnerSay("Lastpayer: " + lastpayername + " = " + (string)lastpayer); 1 Link to comment Share on other sites More sharing options...
sndbad Ghost Posted May 13, 2016 Author Share Posted May 13, 2016 oh thank you thats work :matte-motes-big-grin: 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