- 0
Can someone help me to change a touch menu script to a command listening script?
You are about to reply to a thread that has been inactive for 4142 days.
Please take a moment to consider if this thread is worth bumping.
Please take a moment to consider if this thread is worth bumping.
Question
Cindy Kraai
I got a script wherein when you put it on an object and touch it afterwards it gives you a menu that will change the texture of the object.
what i wanted to happen:
1. change the touch_start to something like listening to a command via local chat
2. or much better, to make a hud that will change the texture of the object (worn & rezzed)
thnks in advance for the replies!
here is the script btw:
integer side = ALL_SIDES;
list texture_list;
list texture_list2;
key user = NULL_KEY;
composelist()
{
integer currenttexture = 0;
integer totaltextures = llGetInventoryNumber(INVENTORY_TEXTURE);
if(totaltextures > 0 & totaltextures <= 12)
{
texture_list = [];
do
{
texture_list = texture_list + llGetInventoryName(INVENTORY_TEXTURE, currenttexture);
currenttexture++;
}
while (currenttexture > 0 & currenttexture < totaltextures);
}
if(totaltextures > 12 & totaltextures <= 22)
{
texture_list = ["Next Page"];
do
{
texture_list = texture_list + llGetInventoryName(INVENTORY_TEXTURE, currenttexture);
currenttexture++;
}
while (currenttexture > 0 & currenttexture < 11);
texture_list2 = ["Last Page"];
do
{
texture_list2 = texture_list2 + llGetInventoryName(INVENTORY_TEXTURE, currenttexture);
currenttexture++;
}
while (currenttexture >= 11 & currenttexture < totaltextures);
}
if(totaltextures > 22)
{
llWhisper(0, "You may only have a maximimum of 22 Textures. Please remove any extra ones.");
}
if(totaltextures == 0)
{
llWhisper(0, "Please add up to 22 Textures inside this object.");
}
}
//The Menu
integer menu_handler;
integer menu_channel;
menu(key user,string title,list texture_list)
{
menu_channel = (integer)(llFrand(99999.0) * -1); //random channel
menu_handler = llListen(menu_channel,"","","");
llDialog(user,title,texture_list,menu_channel);
llSetTimerEvent(30.0); //menu channel open for 30 seconds
}
default
{
state_entry()
{
composelist(); //make list from inventory textures
}
touch_start(integer total_number)
{
user = llDetectedKey(0);
menu(user,"\n\nPlease select one below.",texture_list);
}
listen(integer channel,string name,key id,string message)
{
if (channel == menu_channel)
{
llSetTimerEvent(0.0);
llListenRemove(menu_handler);
if(message == "Next Page")
{
menu(user,"\n\nPlease select one below.",texture_list2);
}
else if(message == "Last Page")
{
menu(user,"\n\nPlease select one below.",texture_list);
}
else
{
llSetTexture(message, side);
}
}
}
timer()
{
llSetTimerEvent(0.0);
llListenRemove(menu_handler);
}
changed(integer change)
{
if (change & CHANGED_INVENTORY) //inventory has changed
{
llSleep(0.5);
composelist();
}
}
}
,,,
Sorry this is my first time to ask question in this forum i don't even know how to reply in it lol..
thank you for answering; however, im really lost cuz im not that really good in scripting, if its not too much can i have a step by step answer like:
1. This is the script for the texture worn or rezzed ["the script goes here"]
2. This is the script for the hud ["the script goes here"]
sorry for being dumb on this =(
Link to comment
Share on other sites
4 answers to this question
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