Unofficial LSL Reference

[[functions:llstopsound]]


Unofficial LSL reference

User Tools

Login

You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.

Login

Forgotten your password? Get a new one: Set new password

This is an old revision of the document!


Function: llStopSound

llStopSound()

Stops the sound playing in the prim the script is running on.

Notes

  • Works only for llPlaySound, llLoopSound, and similar. Does not work for llTriggerSound or llTriggerSoundLimited.

Short examples

llStopSound(); // stops a running sound

Complete examples

This script will start a looped sound when it is touched, and stop it when it is touched again.

llStopSound-example.lsl
integer sound;

default
{
    touch_start(integer n)
    {
        sound = !sound;
        if (sound)
            // Start the Jetpack looped sound
            llLoopSound("67f5e4f0-0534-4d97-bc01-f297648d20e0", vol);
        else
            // Stop it
            llStopSound();
    }
}

See also