Skibidyboparoobopadopa Posted June 29, 2014 Share Posted June 29, 2014 (edited) I'm about to start writing scripts using script extender and I was testing functions. This particular script is meant for tracking if a player is staring down an NPC by tracking there crosshairs using the "xGetPCTarget" function. Can anyone tell me why I keep getting 1 error and where it is? I am using MWEdit version 0.6.1 which I downloaded from Sourceforge. http://sourceforge.net/projects/mwedit/files/mwedit/v0.6.1%20-%20Minor%20Update/=================================================================================================================CODE:=================================================================================================================begin _SETestfloat staretimerlong pctargetshort modeshort scripthasstartedshort IsPlayerStaringshort combatstatusif ( MenuMode == 1 ) returnendifif ( scripthasstarted != 1 ) set scripthasstarted to 1 set mode to 0endifif ( mode == 0 ) if ( pctarg == 0 ) set mode to 1 set IsPlayerStaring to 0 endif if ( IsPlayerStaring == 1 ) set staretimer to ( staretimer + GetSecondsPassed ) if ( staretimer > 10 ) set combatstatus to 1 set staretimer to 0 "_BM_B1"->StartCombat, Player set mode to 2 endif if ( GetDistance, "_BM_B1" < 125 ) set mode to 1 setx pctarget to xGetPCTarget if ( pctarget == 0 ) set staretimer to 0 set mode to 1 set IsPlayerStaring to 0 endif if ( pctarget != "_BM_B1" ) set staretimer to 0 set mode to 1 set IsPlayerStaring to 0 endif if ( pctarget == "_BM_B1" ) set staretimer to ( staretimer + GetSecondsPassed ) set IsPlayerStaring to 1 set mode to 2 endif endif if ( GetDistance, "_BM_B1" > 500 ) set staretimer to ( staretimer + GetSecondsPassed ) if ( staretimer > 10 ) set combatstatus to 1 set staretimer to 0 "_BM_B1"->StartCombat, Player set mode to 2 endif set mode to 1 setx pctarget to xGetPCTarget if ( pctarget == 0 ) set staretimer to 0 set IsPlayerStaring to 0 set mode to 1 endif if ( pctarget != "_BM_B1" ) set staretimer to 0 set IsPlayerStaring to 0 set mode to 1 endif if ( pctarget == "_BM_B1" ) set staretimer to ( staretimer + GetSecondsPassed ) set IsPlayerStaring to 1 set mode to 1 endif endif endif if ( IsPlayerStaring != 1 ) set IsPlayerStaring to 0 set staretimer to 0 set mode to 1 endifendifif ( mode == 1 ) if ( pctarget == 0 ) set mode to 0 set IsPlayerStaring to 0 endif if ( IsPlayerStaring == 1 ) set staretimer to ( staretimer + GetSecondsPassed ) if ( staretimer > 10 ) set combatstatus to 1 set staretimer to 0 "_BM_B1"->StartCombat, Player set mode to 2 endif if ( GetDistance, "_BM_B1" < 125 ) set mode to 0 setx pctarget to xGetPCTarget if ( pctarget == 0 ) set staretimer to 0 set mode to 0 set IsPlayerStaring to 0 endif if ( pctarget != "_BM_B1" ) set staretimer to 0 set mode to 0 set IsPlayerStaring to 0 endif if ( pctarget == "_BM_B1" ) set staretimer to ( staretimer + GetSecondsPassed ) set IsPlayerStaring to 1 set mode to 0 endif endif if ( GetDistance, "_BM_B1" > 500 ) set staretimer to ( staretimer + GetSecondsPassed ) if ( staretimer > 10 ) set combatstatus to 1 set staretimer to 0 "_BM_B1"->StartCombat, Player set staretimer to 0 set mode to 2 endif set mode to 1 setx pctarget to xGetPCTarget if ( pctarget == 0 ) set staretimer to 0 set IsPlayerStaring to 0 set mode to 0 endif if ( pctarget != "_BM_B1" ) set staretimer to 0 set IsPlayerStaring to 0 set mode to 0 endif if ( pctarget == "_BM_B1" ) set staretimer to ( staretimer + GetSecondsPassed ) set IsPlayerStaring to 1 set mode to 0 endif endif endif if ( IsPlayerStaring != 1 ) set IsPlayerStaring to 0 set staretimer to 0 set mode to 0 endifendifif ( mode == 2 ) if ( GetDistance, "_BM_B1" < 125 ) if ( combatstatus == 1 ) set mode to 3 endif if ( combatstatus == 0 ) set IsPlayerStaring to 0 set mode to 0 endif endif if ( GetDistance, "_BM_B1" > 700 ) if ( combatstatus == 1 ) set IsPlayerStaring to 0 "_BM_B1"->StopCombat set combatstatus to 0 set mode to 0 endif if ( combatstatus == 0 ) set IsPlayerStaring to 0 set mode to 0 endif endifendifif ( mode == 3 ) if ( GetDistance, "_BM_B1" < 125 ) if ( combatstatus == 1 ) set IsPlayerStaring to 0 set mode to 2 endif if ( combatstatus == 0 ) set IsPlayerStaring to 0 set mode to 0 endif endif if ( GetDistance, "_BM_B1" > 700 ) if ( combatstatus == 1 ) "_BM_B1"->StopCombat set IsPlayerStaring to 0 set combatstatus to 0 set mode to 2 endif if ( combatstatus == 0 ) set IsPlayerStaring to 0 set mode to 2 endif endifendifend _SETest=================================================================================================================CODE END================================================================================================================= Edited June 29, 2014 by Skibidyboparoobopadopa Link to comment Share on other sites More sharing options...
Recommended Posts