-->

FoxSan's 3D Tools and LSL Script Repository

Tons of LSL scripts, examples and 3D tools, free for all. There are currently 207 scripts and articles in this database.

Play Script (with sound files)

integer nombre ;
integer numero;
 
default {
    state_entry() {
        // lorsque le script passe dans son état par défaut.
        // un “OFF” rouge apparaüt au dessus de la prim
        llSetText("", <1,0,0>, 1.0);
        llSetPrimitiveParams([ PRIM_FULLBRIGHT, ALL_SIDES ,FALSE]);
        nombre = llGetInventoryNumber(INVENTORY_SOUND);
         llStopSound();
    }
    touch_start(integer num_detected) {
        // quand la prim est touchĂ©e, le script passe dans l’état 'on'
        state on;
    }
}
 
state on {
    state_entry() {
        // Lit ce code lorsque le script passe dans l’état ‘on’
        // un "ON" vert apparaĂźt au dessus de la prim
        llSetPrimitiveParams([ PRIM_FULLBRIGHT, ALL_SIDES ,FALSE]);
 
        numero = 0;
        llSetSoundQueueing(TRUE);
        llSetTimerEvent(0.01);
 
    }
    timer()
    {
        llSetTimerEvent(10.0);
        llTriggerSound(llGetInventoryName(INVENTORY_SOUND,numero), 99.5);
        numero = numero + 1;
        if(numero>= nombre) numero = 0;
        llPreloadSound(llGetInventoryName(INVENTORY_SOUND, numero));        
 
    }
    touch_start(integer num_detected) {
        // quand la prim est touchĂ©e, le son s’arrrĂȘte et le script retourne dans son Ă©tat par dĂ©faut
        llStopSound();
        state default;
    }
}

Comments are closed.