Quote:
Originally Posted by JCarter426
Not sure what you want for the perception event... I think if you want to make something happen when an object perceives something, you have to modify its OnPerception script. Also, what you described will never trigger #3. Here it is anyway though, minus the perception stuff:
Code:
void main() {
object oPC = GetFirstPC();
int nLocal = #;
string sGlobal = "****"
string sScript1 = "****1"
string sScript2 = "****2"
string sScript3 = "****3"
if( !GetLocalBoolean(OBJECT_SELF, nLocal) ){
if( GetDistanceBetween(OBJECT_SELF, oPC) <= 7.0 ) {
ActionWait(5.0);
ExecuteScript(sScript1, OBJECT_SELF, -1);
}
else if( GetGlobalBoolean(string sGlobal) ){
if( GetDistanceBetween(OBJECT_SELF, oPC) <= 10.0 ) {
ActionWait(5.0);
ExecuteScript(sScript3, OBJECT_SELF, -1);
}
else if ( GetDistanceBetween(OBJECT_SELF, oPC) <= 5.0 ){
ActionWait(5.0);
ExecuteScript(sScript2, OBJECT_SELF, -1);
}
}
}
|
Thanks JC. The reason I want the perception event is because this is a userdefined script for an NPC. Just out of curiosity, why wouldn't the 3rd condition ever be met?