Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Script help needed - PLEASE!!!

Marlon Brocco
Registered User
Join date: 15 Jul 2005
Posts: 132
05-25-2006 18:46
Can someone please help me with the following script and tell me what's wrong with it? I'm getting the following error: ERROR : Function call mismatches type or number of arguments.

I'm trying to get the script to play the anims and sounds in my vendor to give the appearance of previewing a gesture. Please help. Thanks!
_____________________________

key cur_toucher;
string cur_anim = "";
string cur_sound = "";

default
{
touch_start(integer total_number)
{
integer override=0;

if(llDetectedKey(0)!=cur_toucher)
{
if(cur_anim!="";)
{
llInstantMessage(cur_toucher,"Stopping animation "+ cur_anim);
llStopAnimation(cur_anim);
override=1;
llSetTexture("ClickToTry.tga",3);
}
cur_toucher=llDetectedKey(0);
llRequestPermissions(cur_toucher, PERMISSION_TRIGGER_ANIMATION);
}

if(cur_anim!="" && override!=1)
{
llInstantMessage(cur_toucher,"Stopping animation "+ cur_anim);
llStopAnimation(cur_anim);
cur_anim="";
llSetTexture("ClickToTry.tga",3);
}
else
{
llMessageLinked(1,0,"TRY",llDetectedKey(0));
}
}

link_message(integer sender_num, integer num, string str, key id)
{
list split_data=llCSV2List(str);

cur_anim=llList2String(split_data,0);
integer stop_secs=llList2Integer(split_data,1);
llInstantMessage(cur_toucher, "Waiting 5 seconds to receive permission to allow animation to start.";);
llSleep(5);
llStartAnimation(cur_anim);
llPlaySound(cur_sound);
llSetTexture("ClickToStop.tga",3);
if(stop_secs!=0)
{
llInstantMessage(cur_toucher, "Playing " + cur_anim + "; will stop in " + (string)stop_secs + " seconds automatically.";);
llSleep(stop_secs);
llInstantMessage(cur_toucher, "Stopping " + cur_anim + " automatically; " + (string)stop_secs + " second limit reached.";);
llStopAnimation(cur_anim);
llSetTexture("ClickToTry.tga",3);
cur_anim="";
}
else
{
llInstantMessage(cur_toucher, "Playing " + cur_anim + "; click again to stop!";);
}
}
}
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
05-25-2006 19:01
You are missing an argument for llPlaySound(), you should have a float after the sound cur_sound between 0 and 1 for the volume.

llPlaySound(cur_sound);

should be:

llPlaySound(cur_sound, 0.5);

or whatever number you want in their for volume :)