» Sat Sep 12, 2009 12:40 pm
So for the player, it might just be convenient to use the global script like I mentioned previously.
For NPCs which do not currently have a script, you can create one local script in the CS and specify that same script to control each NPC, since a local script can be reused as many times as you want in the CS.
For NPCs which already have a script, you're stuck with I think two main options. One option is to rewrite each of their respective scripts to also include this functionality, and the other is to make a copy of the NPC local script for each of them and at runtime use "NPC"->StartScript "LocalScript_Name" to target them with it. The problem is, targeted global scripts can only run on one NPC at a time, hence the need to make a copy for each of them. You could probably tie these into the player's global script or a separate one -- check to see if these special NPCs have the right script running on them, and if not, start it.
Good luck!