CODE
integer current_number = 0;
default
{
state_entry()
{
llSay(0,"just drop a bunch of thextures in this prim make the top of the prim small and flatten it so you see 5 sides at once then touch it");
}
touch(integer currentnumber)
{
integer number_of_textures = llGetInventoryNumber(INVENTORY_TEXTURE); // if 5 textures are in inventory, this will return 5.
string sound_name = llGetInventoryName(INVENTORY_TEXTURE, current_number); // llGetInventoryName starts counting at 0.
string sound_name1 = llGetInventoryName(INVENTORY_TEXTURE, current_number+1); // llGetInventoryName starts counting at 0.
string sound_name2 = llGetInventoryName(INVENTORY_TEXTURE, current_number +2); // llGetInventoryName starts counting at 0.
string sound_name3 = llGetInventoryName(INVENTORY_TEXTURE, current_number +3); // llGetInventoryName starts counting at 0.
string sound_name4 = llGetInventoryName(INVENTORY_TEXTURE, current_number +4); // llGetInventoryName starts counting at 0.
llSetTexture(sound_name, 0);
llWhisper(0,(string)sound_name);
llSetTexture(sound_name1, 1);
llWhisper(0,(string)sound_name1);
llSetTexture(sound_name2, 2);
llWhisper(0,(string)sound_name2);
llWhisper(0,(string)sound_name3);
llSetTexture(sound_name3, 3);
llWhisper(0,(string)sound_name4);
llSetTexture(sound_name4, 4);
current_number = current_number+5; // increment current_number.
// greater-than or equal because of staggered counting.
if (current_number >= number_of_textures)
{
current_number = 0;
}
}
}