Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Releases & Resources
  3. [Release] Riot Shield Bounce GSC

[Release] Riot Shield Bounce GSC

Scheduled Pinned Locked Moved BO2 Modding Releases & Resources
3 Posts 3 Posters 823 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Former User? Offline
    A Former User? Offline
    A Former User
    wrote on last edited by A Former User
    #1

    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. 🙂

    mikzyundefined 1 Reply Last reply
    1
    • Toysundefined Offline
      Toysundefined Offline
      Toys VIP
      wrote on last edited by
      #2

      love it

      1 Reply Last reply
      0
      • mikzyundefined Offline
        mikzyundefined Offline
        mikzy Banned
        replied to A Former User on last edited by
        #3

        Skid thank you for this, putting into our servers 🙂

        1 Reply Last reply
        0

        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Donate