Collision Sound

Date 2010/5/12 5:12:24 | Topic: Sound

Will play a sound that is inside prim with script when avatar walks onto object.


// Sound must be in the object's inventory or it will not work. 
// First sound in inventory will be used if more than 1

integer delay 5//how many seconds to wait after playing sound before it can be triggered again


default
{
    
on_rezinteger sparam )
    {
        
llResetScript();
    }
    
    
state_entry()
    {
        
llOwnerSay("This object must not be set to phantom or it will not work.");
    }

    
collision_start(integer total_number)
    {
        
llPlaySound(llGetInventoryName(INVENTORY_SOUND,0), 1);
        
llSleep(delay); //keeps it from playing sound over and over
    
}
}




This script comes from Alicia Stella Design - Best Tip Jars in Second Life
http://www.aliciastella.com

The URL for this script is:
http://www.aliciastella.com/modules/AMS/article.php?storyid=37