This is a very short script that I have been asked to created by MrChristian Luminos who told me that there is no such script available either on marketplace or the wiki. The script just toggles a sound on and off when an avatar touches the primitive the script is in.
SOUND
parameter at the top of the script to reference a sound UUID
or a sound name if the sound-clip is in the same primitive this script will be placed in. The script triggers one of my sneezing recording from Wizardry and Steamworks./////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2011 - License: GNU GPLv3 // // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // // rights of fair usage, the disclaimer and warranty conditions. // /////////////////////////////////////////////////////////////////////////// // Change this to either the NAME of a sound in the same primitive // as this script, OR the key of the sound to be played if it is not // in the same primitive as this script. string SOUND = "9fb1f482-5edf-1544-98c4-b8f86ea9ea26"; integer o = -1; default { touch_start(integer total_number) { if(o = ~o) { llStopSound(); return; } llLoopSound(SOUND, 1); } }
The sound is played using llLoopSound
and at volume 1 (maximum). However, you can replace those with say:
llPlaySound(SOUND, .5);
If you want the sound to be played just once and at half volume.