Jump to content

Home

tsl- animation script question


newbiemodder

Recommended Posts

I have multiple npc's in an area..they all have the same tag..I want them to perform the same animation( use computer) when a door is opened..can I alter this script to make it happen or is there a another script to do this:

 

void main() {

 

AssignCommand(GetObjectByTag("ABC"), ActionPlayAnimation(10044, 1.0, -1.0));

}

Link to comment
Share on other sites

I think you'd need to loop through all the individual NPC's, since GetObjectByTag() only returns the first NPC with that tag, so you could try this:

 

void main() {
string sTag = [color=cyan]"Tag_Of_NPCs"[/color];
int i = 0;
object oChar = GetObjectByTag(sTag, 0);
while(oChar != OBJECT_INVALID) {
	AssignCommand(oChar, ActionPlayAnimation(10044, 1.0, -1.0));

	i++;
	oChar = GetObjectByTag(sTag, i);
}
}

 

I'd scanned through for syntax errors, but I generally let a few one's slip by me :p If for any reason it doesn't work, just post back ;)

 

Hope that helps!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...