Post: [SCRIPT] Bunny Hopping
06-11-2012, 07:07 PM #1
(adsbygoogle = window.adsbygoogle || []).push({});
nothing amazing about this, just something ive found through the game files produced by the makers of deathrun, ill optimize it after if anyone wants it optimized. btw this hasn't been tested


    bunnyHoop()
{
self endon("disconnect");
self endon("spawned_player");
self endon("joined_spectators");
self endon("death");

if( !level.dvar["bunnyhoop"] )
return;

wait 2; // this is just to make sure that new players won't spawn and bunny hoop in 1st frame

// mnaauuu
last = self.origin;
lastBH = 0;
lastCount = 0;
// ----- //

while( isAlive( self ) )
{
// mnaauuu
dist = distance(self.origin, last);
last = self.origin;
if ( dist > 450 && lastBH && lastCount > 5)
{
num = self getEntityNumber();
guid = self getGuid();
logPrint( "LJ;" + guid + ";" + num + ";" + self.name + ";\n" );
self iprintln("^3Lagjump? ^1DIE!");
self suicide();
}
lastBH = self.doingBH;
wait 0.1;
self setClientDvar( "com_maxfps", 250 ); // what is this for?
// ----- //

stance = self getStance();
useButton = self useButtonPressed();
onGround = self isOnGround();
fraction = bulletTrace( self getEye(), self getEye() + vector_scale(anglesToForward(self.angles), 32 ), true, self )["fraction"];

// Begin
if( !self.doingBH && useButton && !onGround && fraction == 1 )
{
self setClientDvars( "bg_viewKickMax", 0, "bg_viewKickMin", 0, "bg_viewKickRandom", 0, "bg_viewKickScale", 0 );
self.doingBH = true;
lastCount = 0;
}

// Accelerate
if( self.doingBH && useButton && onGround && stance != "prone" && fraction == 1 )
{
lastCount++;
if( self.bh < 120 )
self.bh += 30;
}

// Finish
if( self.doingBH && !useButton || self.doingBH && stance == "prone" || self.doingBH && fraction < 1 )
{
self setClientDvars( "bg_viewKickMax", 90, "bg_viewKickMin", 5, "bg_viewKickRandom", 0.4, "bg_viewKickScale", 0.2 );
self.doingBH = false;
self.bh = 0;
lastCount = 0;
continue;
}

// Bounce
if( self.bh && self.doingBH && onGround && fraction == 1 )
{
bounceFrom = (self.origin - vector_scale( anglesToForward( self.angles ), 50 )) - (0,0,42);
bounceFrom = vectorNormalize( self.origin - bounceFrom );
self bounce( bounceFrom, self.bh );
self bounce( bounceFrom, self.bh );
wait 0.1;
}
}
}


How to Use: Press Sprint + Use (square) & jump (x) to bunny hop.

Video - skip to 0:40 seconds




Credit goes to lau12345671 for the vid and Brax for scripting this.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 5 users say thank you to Uk_ViiPeR for this useful post:

Correy, forflah123, Harry, KingcreekS, Taylor
06-11-2012, 08:23 PM #11
Originally posted by ViiPeR View Post
nothing amazing about this, just something ive found through the game files produced by the makers of deathrun, ill optimize it after if anyone wants it optimized.


    bunnyHoop()
{
self endon("disconnect");
self endon("spawned_player");
self endon("joined_spectators");
self endon("death");

if( !level.dvar["bunnyhoop"] )
return;

wait 2; // this is just to make sure that new players won't spawn and bunny hoop in 1st frame

// mnaauuu
last = self.origin;
lastBH = 0;
lastCount = 0;
// ----- //

while( isAlive( self ) )
{
// mnaauuu
dist = distance(self.origin, last);
last = self.origin;
if ( dist > 450 && lastBH && lastCount > 5)
{
num = self getEntityNumber();
guid = self getGuid();
logPrint( "LJ;" + guid + ";" + num + ";" + self.name + ";\n" );
self iprintln("^3Lagjump? ^1DIE!");
self suicide();
}
lastBH = self.doingBH;
wait 0.1;
self setClientDvar( "com_maxfps", 250 ); // what is this for?
// ----- //

stance = self getStance();
useButton = self useButtonPressed();
onGround = self isOnGround();
fraction = bulletTrace( self getEye(), self getEye() + vector_scale(anglesToForward(self.angles), 32 ), true, self )["fraction"];

// Begin
if( !self.doingBH && useButton && !onGround && fraction == 1 )
{
self setClientDvars( "bg_viewKickMax", 0, "bg_viewKickMin", 0, "bg_viewKickRandom", 0, "bg_viewKickScale", 0 );
self.doingBH = true;
lastCount = 0;
}

// Accelerate
if( self.doingBH && useButton && onGround && stance != "prone" && fraction == 1 )
{
lastCount++;
if( self.bh < 120 )
self.bh += 30;
}

// Finish
if( self.doingBH && !useButton || self.doingBH && stance == "prone" || self.doingBH && fraction < 1 )
{
self setClientDvars( "bg_viewKickMax", 90, "bg_viewKickMin", 5, "bg_viewKickRandom", 0.4, "bg_viewKickScale", 0.2 );
self.doingBH = false;
self.bh = 0;
lastCount = 0;
continue;
}

// Bounce
if( self.bh && self.doingBH && onGround && fraction == 1 )
{
bounceFrom = (self.origin - vector_scale( anglesToForward( self.angles ), 50 )) - (0,0,42);
bounceFrom = vectorNormalize( self.origin - bounceFrom );
self bounce( bounceFrom, self.bh );
self bounce( bounceFrom, self.bh );
wait 0.1;
}
}
}


How to Use: Press Sprint + Use (square) & jump (x) to bunny hop.

Video - skip to 0:40 seconds




Credit goes to lau12345671 for the vid and the producers of the deathrun mod in the cod4 scene.
it was Brax who made the script just so you know. his new name is Braxi.
06-11-2012, 09:05 PM #12
Originally posted by IVI40A3Fusionz View Post
This has a few errors.

self bounce - Unknown function.
logPrint - Unknown function.

Only ones that caught my eye straight away :p.

Originally posted by x. View Post
??

(too short)


it may be missing its original source script, ill fix it when i find it tomorrow.

---------- Post added at 10:05 PM ---------- Previous post was at 10:04 PM ----------

Originally posted by IELIITEMODZX View Post
it was Brax who made the script just so you know. his new name is Braxi.


ok thanks Smile

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo