[Release] Riot Shield Bounce GSC

Topic created ยท 3 Posts ยท 134 Views
  • For those that are opposed to using sv_enableBounces, I am releasing a simple gsc script that will spawn "bounces" on a riot shield. (Make sure sv_enableBounces is set to 0 or the velocity will be terribly wrong.

    Place in onPlayerSpawned, preferably in a welcome message or other statement that is only threaded once.

    if(!isDefined(player.pers["isBot"])&& !player.pers["isBot"]){
         self thread spawn_shield_bounce();
         self.spawned_shields =[];
         self thread yeet_shields();
    }
    

    Place wherever your functions may be located...ie; the bottom of your script.

    spawn_shield_bounce(){
        self endon("disconnect");
        self endon("game_ended");
        self.bounce = false;
    	for(;;){
    		if(isDefined(self.riotshieldretrievetrigger) && isDefined(self.riotshieldentity) && self.bounce == false){ /*thanks to DoktorSAS for finding the riotshield variables*/
    			bounce_location = spawn("script_model", self.origin + (0, 0, 20));
    			bounce_location thread bounce_logic(600);
    			self.spawned_shields[self.spawned_shields.size] = bounce_location;
    			self.bounce = true;
    			wait 0.02;
                    }
    		else{
    			wait 0.02;
    		}
    		wait 0.05;
    	}
    }
    yeet_shields(){
        self endon("disconnect");
        self endon("game_ended");
    	for(;;){
    		self waittill("destroy_riotshield");
    		array_delete(self.spawned_shields);
    		self.bounce = false;
    		wait 0.05;
    	}
    }
    bounce_logic(z_axis_velocity){
        while(isDefined(self)){
            foreach(player in level.players){
            	if(!isDefined(player.pers["isBot"])&& !player.pers["isBot"]){
    	            if(Distance(self.origin, player.origin) < 50){
    	                player SetVelocity(player GetVelocity() + (0, 0, z_axis_velocity));
    	            }
    	        }
            }
            wait .01;
        }
    }
    

    Example
    Cheers, hope this helps some of you modders. ๐Ÿ™‚

  • love it

  • @Skid thank you for this, putting into our servers ๐Ÿ™‚

Log in to reply