Jump to content

remove texture from content


sndbad Ghost
 Share

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

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

Recommended Posts

 hi guys
i make this script for remove texture if more than 24 characters when i drop texture in invintory
its work fine but i have a little bug when i add texture with 23 characters and down the script stop working

integer removetexture;
default
{
    changed(integer change)
    {
                if (change & CHANGED_INVENTORY) 
        {

            string removename = llGetInventoryName(INVENTORY_TEXTURE, removetexture);

           if ( llStringLength(removename) >24)
            {
                   llSay( 0,removename+"it removed"); 
               llRemoveInventory(removename);
            }
        }
  
    }
}
Link to comment
Share on other sites

Well, let's see.....

The global variable, removetexture, has the value zero.  So

string removename = llGetInventoryName(INVENTORY_TEXTURE,removetexture)

will always look for the first named texture in the object's contents.  If you drop a texture in the object and it is not removed, the next texture you drop in will either be the first texture or the second texture in Contents, depending on alphabetical order.  I'm guessing that its name is later in the alphabet.  If so, your script won't even look at it.  It's only looking for

llGetInventoryName(INVENTORY_TEXTURE,0)

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3069 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...