Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

adding sound

lordneg Matzerath
Registered User
Join date: 8 Jun 2006
Posts: 18
03-21-2007 02:33
hello all i have this script that draws my sword when i touch the scabard. i found it in another sword and took it to put in mine can anyone tell me were i would put the play sound so that it will play and how to write it up so i dont get errors . or if this is ven possable do i have to put it in the sword itself maybe thnks alot.

// Place this script in the root prim of the scabbard

integer toggle = FALSE ;

default
{
touch_start( integer num )
{
toggle =! toggle ;

if( toggle )
{
llWhisper( 1, "draw" ) ;

llMessageLinked( LINK_SET, 0, "draw", "" ) ;

}

else
{
llWhisper( 1, "sheath" ) ;
llMessageLinked( LINK_SET, 0, "sheath", "" ) ;
}
}
}
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
03-21-2007 05:52
What errors are you getting?

CODE

integer toggle = FALSE ;

default
{
touch_start( integer num )
{
toggle =! toggle ;

if( toggle )
{
llWhisper( 1, "draw" ) ;
llPlaySound("draw sword sound",1.0);
llMessageLinked( LINK_SET, 0, "draw", "" ) ;
}
else
{
llWhisper( 1, "sheath" ) ;
llMessageLinked( LINK_SET, 0, "sheath", "" ) ;
llPlaySound("sheath sword sound",1.0);}
}
}
}
lordneg Matzerath
Registered User
Join date: 8 Jun 2006
Posts: 18
03-21-2007 06:16
thnks for the help i was getting syntex error or some such. i notice you put in llPlaySound("draw sword sound",1.0); this part here ,1.0. I didnt know anything about numbers. I took that part and added it to my script and its working. you rock thnks aton :)
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
03-21-2007 09:26
The 1.0 specifies full volume.