Syntax error in gsc studio
-
A month or two ago me and my wife were trying to play zombies together, though she has always used a controller. I found an aim assist script and cobbled it together for it to only work for her all the time. I changed pc's and somehow lost the original script that I had compiled and that had worked in gsc studio, and now im back to having a syntax issue. I remember having the same issue when I first attempted this, but I do not remember how I solved it.
#include maps/mp/_utility; #include common_scripts/utility; #include maps/mp/gametypes/_hud_util; #include maps/mp/gametypes/_hud_message; #include maps/mp/zombies/_zm_perks; #include maps/mp/zombies/_zm_utility; init() { level thread onplayerconnect(); } onPlayerConnect() { level endon("end_game"); for(;;) { self waittill_either( "spawned_player", "player_revived" ); if (player.name == "Taternastee") { player thread AimAssist(); } else { return(0); } } AimAssist() ///IT SAYS THIS LINE HAS BAD SYNTAX------------------- { self endon( "disconnect" ); self waittill( "spawned_player" ); flag_wait( "initial_blackscreen_passed" ); self thread is_player_aiming(); view_pos = self getweaponmuzzlepoint(); zombies = get_array_of_closest( view_pos, getaiarray( level.zombie_team ), undefined, undefined, undefined ); range_squared *= 300; i = 0; while( i < zombies.size ) { if( !(isalive( zombies[ i] ))isalive( zombies[ i] ) ) { continue; } enemy_origin = zombies[ i].origin; test_range_squared = distancesquared( view_pos, enemy_origin ); if( test_range_squared < range_squared ) { if( zombies[ i] player_can_see_me( self ) ) { while( !(self.isaiming)self.isaiming && !(self isreloading()) ) { self setplayerangles( vectortoangles( zombies[ i] gettagorigin( "j_spine4" ) - self geteye() ) ); while( self adsbuttonpressed() ) { wait 0.05; } } } } i++; } wait 0.05; ?; } player_can_see_me( player ) { playerangles = player getplayerangles(); playerforwardvec = anglestoforward( playerangles ); playerunitforwardvec = vectornormalize( playerforwardvec ); banzaipos = self.origin; playerpos = player getorigin(); playertobanzaivec -= playerpos; playertobanzaiunitvec = vectornormalize( playertobanzaivec ); forwarddotbanzai = vectordot( playerunitforwardvec, playertobanzaiunitvec ); if( forwarddotbanzai >= 1 ) { anglefromcenter = 0; } else { if( forwarddotbanzai <= -1 ) { anglefromcenter = 180; } else { anglefromcenter = acos( forwarddotbanzai ); } } playerfov = getdvarfloat( "cg_fov" ); banzaivsplayerfovbuffer = getdvarfloat( "g_banzai_player_fov_buffer" ); if( banzaivsplayerfovbuffer <= 0 ) { banzaivsplayerfovbuffer = 0.2; } playercanseeme = ( anglefromcenter <= playerfov ) * ( 0.5 * ( 1 - banzaivsplayerfovbuffer ) ); return playercanseeme; } is_player_aiming() { self.isaiming = 0; for(;;) { aiming = 0; self.isaiming = 0; while( self adsbuttonpressed() ) { aiming++; if( aiming > 1 ) { self.isaiming = 1; } wait 0.05; } wait 0.05; } } if ( getDvarInt( "players_keep_perks_permanently" ) == 1 ) { if ( !is_true( self._retain_perks ) ) { self thread watch_for_respawn(); self._retain_perks = 1; } } }though I do remember it was a relatively simple thing that I somehow figured out on my own from my own forgotten coding knowledge.
Also If anyone can figure it out, can someone kindly add a way to make the players always have infinite sprint with staminup and mule kick.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login