User:Decimus Schomer/Scripts/Texture changer
Decimus' user page | Decimus' talk page | Decimus' scripts | Decimus' script libraries | Decimus' projects
Main scripts page | Toggling Rotate script | UUID-getter scripts | Texture changer | Channel spier | Chatbot | Jump slab | Emailer | Fractal viewer | Grammar analyser | SPD viewer
This script changes the texture of an object in response to specific text.
list TEXTURES = [ // "text", "texture" "open", "opened", "close", "closed" ]; default { state_entry() { llListen(0,"",llGetOwner(),""); // Multiple listens are bad, if they're all on the same channel. } listen(integer channel, string name, key id, string message) { integer pos = llListFindList(TEXTURES,[llToLower(message)]); if(~pos) { llSetTexture(llList2String(TEXTURES, pos+1),ALL_SIDES); } } }
To add textures, add another pair of entries to TEXTURES in the format "message to say", "texture-name-or-key". The message should be lowercase, and the name is case sensitive.