Jump to content

Need help with a script (permission owner/group/all)


Magra Morlim
 Share

You are about to reply to a thread that has been inactive for 3760 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

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

You are about to reply to a thread that has been inactive for 3760 days.

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
 Share

×
×
  • Create New...