newbiemodder Posted October 7, 2009 Share Posted October 7, 2009 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 More sharing options...
glovemaster Posted October 8, 2009 Share Posted October 8, 2009 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 If for any reason it doesn't work, just post back Hope that helps! Link to comment Share on other sites More sharing options...
newbiemodder Posted October 8, 2009 Author Share Posted October 8, 2009 It works...thx glovemaster, you're the best. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.