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!"
;}
}
}
