Magra Morlim Posted December 10, 2013 Share Posted December 10, 2013 Hello people,i want to make this script fit to my needs, its a free script but I need it that it only listens to OWNER.Atm it listens to everyone. Trying to get that work a whole day now....near desperating...pls help me :matte-motes-dont-cry:// Script Name: Texture_switcher_for_many_textures.lsl // CATEGORY: Texture // CREATED: 2011-10-06 15:56:27.900 // EDITED: 2011-10-06 15:56:27.900 // AUTHOR: Ferd Frederix // COMPATIBILITY: Second Life // Texture switcher with many levels of menus // Downloaded from : http://www.free-lsl-scripts.com/cgi/freescripts.plx?ID=880 // This program is free software; you can redistribute it and/or modify it. // Additional Licenes may apply that prevent you from selling this code // You must leave any author credits and any headers intact in any script you use or publish. // If you don't like these restrictions and licenses, then don't use these scripts. //////////////////////// ORIGINAL AUTHORS CODE BEGINS //////////////////////////////////////////// // Texture switcher with many levels of menus integer i = 0; integer currentPos = 0; integer listener; integer MENU_CHANNEL ; // opens menu channel and displays dialog Dialog(key id) { list MENU1 = []; // count the textures in the prim to see if we need pages integer c = llGetInventoryNumber(INVENTORY_TEXTURE); if (c <= 12) { for (i = 0; i < c; i++ ) { MENU1 += llGetInventoryName(INVENTORY_TEXTURE, i); } } else { for (i = 10 * currentPos; i < (10 + (10 * currentPos)) ; i++) { // check to make sure name <= 24, or else the menu will not work. string aname = llGetInventoryName(INVENTORY_TEXTURE, i); if ( llStringLength(aname) >24) { llOwnerSay("The texture named " + aname + " has too long of a name to be used, please give it a shorter name <= 24 characters "); } else { if (i < c ) { MENU1 += aname; } } } MENU1 += ">>"; if (currentPos != 0) MENU1 += "<<"; else MENU1 += "-"; } MENU_CHANNEL = (integer) (llFrand(10000) + 10000); listener = llListen(MENU_CHANNEL, "", NULL_KEY, ""); llDialog(id, "Select one object below: ", MENU1, MENU_CHANNEL); } default { on_rez(integer num) { // reset scripts on rez llResetScript(); } touch_start(integer total_number) { // display the dialog Dialog(llDetectedKey(0)); } listen(integer channel, string name, key id, string message) { if (channel == MENU_CHANNEL) { llListenRemove(listener); if (message == ">>") { currentPos ++; Dialog(id); } else if (message == "<<") { currentPos--; if (currentPos < 0) currentPos = 0; Dialog(id); } else { // display the texture from menu selection llSetTexture(message, ALL_SIDES); } } } } Ty 4 any suggeastions/solutions. Good night :matte-motes-sarcasm: Link to comment Share on other sites More sharing options...
Rolig Loon Posted December 10, 2013 Share Posted December 10, 2013 In your touch_start event, all you need to do is check to see if(llGetOwner() == llDetectedKey(0)) Link to comment Share on other sites More sharing options...
Magra Morlim Posted December 10, 2013 Author Share Posted December 10, 2013 Lol i have made a few try's with this "if(llGetOwner()==llDetectedKey(0))" as you wrote, but with my alt i can use menu anyway....hmm..maybe I was to tired yesterday. I try that again. Ty Rolig Link to comment Share on other sites More sharing options...
Magra Morlim Posted December 10, 2013 Author Share Posted December 10, 2013 Thank you again Rolig, it works, i know now i put "if(llGetOwner() == llDetectedKey(0))" on the wrong place. Makes it a difference between "if(llGetOwner() == llDetectedKey(0))" or "if(llDetectedKey(0) == llGetOwner())" it should be the same result or? Link to comment Share on other sites More sharing options...
Rolig Loon Posted December 10, 2013 Share Posted December 10, 2013 Neat. I'm glad you got it to work. It makes no difference which order you write the test. You are asking the script to determine whether the two variables have the same value, so A == B is the same as B == A. Link to comment Share on other sites More sharing options...
LovingAndRejected Posted December 11, 2013 Share Posted December 11, 2013 additionally you can restrict the listener by saying llListen(MENU_CHANNEL, "", id, ""); Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now