View Single Post
Old 06-14-2012, 01:16 AM   #198
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,636
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);

		}

	}

}


JCarter426 is offline   you may: quote & reply,