I am novice in scripting, I get basic texture cycle on touch script and add some functionality but there is one thing not working. I want it show the current texture name as hover text and change the name as touched. it shows the first texture's name but I think there must be something more to cycle the names with textures .
Here is the code :
integer number;
string name;
integer choice = 0;
default
{
state_entry()
{
number = llGetInventoryNumber(INVENTORY_TEXTURE);
number -= 1;
name = llGetInventoryName(INVENTORY_TEXTURE, choice);
if (name != ""

{
llSetTexture(name, ALL_SIDES);
choice = choice + 1;
}
{
string msg= llGetObjectName() ;
msg+="\n " + (string)llGetInventoryNumber(INVENTORY_TEXTURE) + " Textures L$" + llGetObjectDesc();
msg+="\n " + name ;
llSetText(msg ,<1,1,1>,1);
}
}
touch_start(integer total_number)
{
if (choice < number)
{
name = llGetInventoryName(INVENTORY_TEXTURE, choice);
if (name != ""

{
llSetTexture(name, ALL_SIDES);
choice = choice + 1;
}
}
else
{
name = llGetInventoryName(INVENTORY_TEXTURE, choice);
if (name != ""

{
llSetTexture(name, ALL_SIDES);
choice = 0;
}
}
}
changed(integer change)
{
if (change & CHANGED_INVENTORY)
{
llResetScript();
}
}
}