Jump to content

Chat Command Animation - Turn on and off.


Amethyst Dominica
 Share

You are about to reply to a thread that has been inactive for 4654 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Awhile ago, I asked for help with a script. What I wanted basically was a way to place an animation into a prim, attach it to an avatar, and then have the animation in the prim turn on and off via chat command (Like a fan that an avatar can start and stop waving via chat command). I received this: string gsAnim = ""; //put the anim to be played here string gsCommStart = "start"; //put the command for playing the anim here string gsCommStop = "stop"; //put the command for stop playing the anim here integer giChannel = 11; //channel for the commands integer giListener; default { attach(key id) { if(id != NULL_KEY) { llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); } else { llListenRemove(giChannel); } } run_time_permissions(integer perm) { if(PERMISSION_TRIGGER_ANIMATION & perm) { giChannel = llListen(giChannel, "", llGetOwner(), ""); } } listen(integer channel, string name, key id, string msg) { if(llToLower(llStringTrim(msg, STRING_TRIM)) == gsCommStart) { llStartAnimation(gsAnim); } else if (llToLower(llStringTrim(msg, STRING_TRIM)) == gsCommStop) { llStopAnimation(gsAnim); } } } It seemed to work, but the problem is, when I tried giving the fan I had made to another person, (or selling it) the script stopped working. Is there any way to fix this script? (Bear in mind, I have no idea how to script myself. And I'd be happy to buy such a script if it were for sale anywhere. If you want to just toss a string of text at me and say "Here, put this in your script somewhere" it's not going to be very helpful because I'll have no idea where to put it..) I would appreciate any substantial help anyone would be willing to give me. ^_^) Thanks in advance!
Link to comment
Share on other sites

try this:

string gsAnim = ""; //put the anim to be played herestring gsCommStart = "start"; //put the command for playing the anim herestring gsCommStop = "stop"; //put the command for stop playing the anim hereinteger giChannel = 11; //channel for the commandsinteger giListener;default {	state_entry()	{		llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);	}	attach(key id) {		if(id != NULL_KEY) {			llResetScript();		}	}	} run_time_permissions(integer perm) {		if(PERMISSION_TRIGGER_ANIMATION & perm) {			giChannel = llListen(giChannel, "", llGetOwner(), "");		}	}	listen(integer channel, string name, key id, string msg) {		if(llToLower(llStringTrim(msg, STRING_TRIM)) == gsCommStart) {			llStartAnimation(gsAnim);		} else if (llToLower(llStringTrim(msg, STRING_TRIM)) == gsCommStop) {			llStopAnimation(gsAnim);		}	}} 

 Btw:

If you want to make it easier for people to help you, paste formated code, please :)

  • Like 1
Link to comment
Share on other sites

Awww. The code you gave me doesn't work. It says there's a problem with line 17, Column 6 And I really have no idea how to post code so it appears formatted in the forum here. (I don't see any buttons anywhere that would allow me to do that.) If the code does work, then I'm not sure if I'm just putting the animation name/ channel info in the wrong places. ) Sorry to bother you again.

Link to comment
Share on other sites

*snickers* it was just a } too much - which, however made me see the original mistake.

string gsAnim = ""; //put the anim to be played herestring gsCommStart = "start"; //put the command for playing the anim herestring gsCommStop = "stop"; //put the command for stop playing the anim hereinteger giChannel = 11; //channel for the commandsinteger giListener;default {	state_entry()	{		llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);	}	attach(key id) {		if(id != NULL_KEY) {			llResetScript();		}	}	run_time_permissions(integer perm) {		if(PERMISSION_TRIGGER_ANIMATION & perm) {			llListen(giChannel, "", llGetOwner(), "");		}	}	listen(integer channel, string name, key id, string msg) {		if(llToLower(llStringTrim(msg, STRING_TRIM)) == gsCommStart) {			llStartAnimation(gsAnim);		} else if (llToLower(llStringTrim(msg, STRING_TRIM)) == gsCommStop) {			llStopAnimation(gsAnim);		}	}} 

 

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4654 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...