Table of Contents

Shortnote

This script was tested and works on OpenSim version 0.7.4!

The script sets the primitive's texture to FIRST_TEXTURE_NAME. When the user touches the primitive, it sets the primitive's texture to SECOND_TEXTURE_NAME. The script then sleeps for 5 seconds using llSetTimerEvent(5) and sets the primitive's texture back to FIRST_TEXTURE_NAME.

Setup

FIRST_TEXTURE_NAME and SECOND_TEXTURE_NAME must be changed to the name of two textures that are placed along with the script in the primitive. Alternatively, UUIDs can be used instead of names which would not require the textures to be present in the primitive's inventory.

Code

texture_switchback.lsl
default {
  state_entry() {
    llSetTexture("FIRST_TEXTURE_NAME", ALL_SIDES);
  }
  touch_start(integer num) {
    state set;
  }
}
state set {
  state_entry() {
    llSetTexture("SECOND_TEXTURE_NAME", ALL_SIDES);
    llSetTimerEvent(5);
  }
  timer() {
    llSetTimerEvent(0);
    state default;
  }
}

secondlife/texture_switchback.txt ยท Last modified: 2022/11/24 07:46 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.