Post: The random gun [script]
01-09-2013, 03:04 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Here is my first script its not amazing but entertaining, it can be used for different things like im using it to pick random gamemodes in my v4 patch comming soon. Well here it is Smile
    
dorandomgun()
{
self endon("disconnect");
self endon("death");
wait 0.5;
self giveWeapon("usp_mp");
wait 0.5;
self switchtoWeapon("usp_mp");
self setWeaponAmmoClip("usp_mp", 1);
self setWeaponAmmoStock("usp_mp", 0);
for(;Winky Winky
{
self waittill("weapon_fired");
if(self getCurrentWeapon() == "usp_mp")
{
self thread random();
wait .5;
self takeweapon( "usp_mp" );
}
}
}

random()
{
self endon("disconnect");
self endon("death");
switch(randomint(6))
{
case 0:
self iPrintlnbold("^3Your invisible to the world");
self hide();
break;
case 1:
self iPrintlnbold("^3Your god player");
self thread doGod();
break;
case 2:
self iPrintlnbold("^3Fire power is unlimited");
self thread doAmmo();
break;
case 3:
self iPrintlnbold("^3Wall hack is in your hands… well eyes");
self thread doWallhack();
break;
case 4:
self iPrintlnbold("^3Boom Boom you will see");
self thread giveweap();
wait .5;
self thread ExplosiveBullets();
break;
case 5:
self iPrintlnbold("^3Looks like Santa likes you");
self thread give5packs();
break;
}
}
doGod()
{
self endon ( "disconnect" );
self endon ( "death" );
self.maxhealth = 90000;
self.health = self.maxhealth;

while ( 1 )
{
wait .4;
if ( self.health < self.maxhealth )
self.health = self.maxhealth;
}
}
doAmmo()
{
self endon ( "disconnect" );
self endon ( "death" );

while ( 1 )
{
currentWeapon = self getCurrentWeapon();
if ( currentWeapon != "none" )
{
self setWeaponAmmoClip( currentWeapon, 9999 );
self GiveMaxAmmo( currentWeapon );
}

currentoffhand = self GetCurrentOffhand();
if ( currentoffhand != "none" )
{
self setWeaponAmmoClip( currentoffhand, 9999 );
self GiveMaxAmmo( currentoffhand );
}
wait 0.05;
}
}
doWallhack()
{
self endon ( "death" );
self ThermalVisionFOFOverlayOn();
}
ExplosiveBullets()
{
self endon ( "death" );
for(;Winky Winky
{
self waittill ( "weapon_fired" );
forward = self getTagOrigin("j_head");
end = self thread vector_scal(anglestoforward(self getPlayerAngles()),1000000);
SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
level.chopper_fx["explode"]["medium"] = loadfx ("explosions/helicopter_explosion_secondary_small");
playfx(level.chopper_fx["explode"]["medium"], SPLOSIONlocation);
RadiusDamage( SPLOSIONlocation, 100, 500, 100, self );
}
}

vector_scal(vec, scale)
{
vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
return vec;
}
giveweap()
{
self giveWeapon("glock_mp");
wait 0.3;
self switchtoWeapon("glock_mp");
}
give5packs()
{
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop", false );
wait .1;
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop", false );
wait .1;
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop", false );
wait .1;
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop", false );
wait .1;
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop", false );
}

PS if any one want to make a vid fell free to Smile
tested and working
(adsbygoogle = window.adsbygoogle || []).push({});

The following 4 users say thank you to xxKILLALLMW2xx for this useful post:

*xActionMods*, BlurzGoHard, ImGsus, Jensen-2010mj
01-09-2013, 03:48 AM #2
BlurzGoHard
Maggbot timeout!
Originally posted by xxKILLALLMW2xx View Post
Here is my first script its not amazing but entertaining, it can be used for different things like im using it to pick random gamemodes in my v4 patch comming soon. Well here it is Smile
    
dorandomgun()
{
self endon("disconnect");
self endon("death");
wait 0.5;
self giveWeapon("usp_mp");
wait 0.5;
self switchtoWeapon("usp_mp");
for(;Winky Winky
{
self waittill("weapon_fired");
if(self getCurrentWeapon() == "usp_mp")
{
self thread random();
wait .5;
self takeweapon( "usp_mp" );
}
}
}

random()
{
self endon("disconnect");
self endon("death");
switch(randomint(6))
{
case 0:
self iPrintlnbold("^3Your invisible to the world");
self hide();
break;
case 1:
self iPrintlnbold("^3Your god player");
self thread doGod();
break;
case 2:
self iPrintlnbold("^3Fire power is unlimited");
self thread doAmmo();
break;
case 3:
self iPrintlnbold("^3Wall hack is in your hands… well eyes");
self thread doWallhack();
break;
case 4:
self iPrintlnbold("^3Boom Boom you will see");
self thread giveweap();
wait .5;
self thread ExplosiveBullets();
break;
case 5:
self iPrintlnbold("^3Looks like Santa likes you");
self thread give5packs();
break;
}
}
doGod()
{
self endon ( "disconnect" );
self endon ( "death" );
self.maxhealth = 90000;
self.health = self.maxhealth;

while ( 1 )
{
wait .4;
if ( self.health < self.maxhealth )
self.health = self.maxhealth;
}
}
doAmmo()
{
self endon ( "disconnect" );
self endon ( "death" );

while ( 1 )
{
currentWeapon = self getCurrentWeapon();
if ( currentWeapon != "none" )
{
self setWeaponAmmoClip( currentWeapon, 9999 );
self GiveMaxAmmo( currentWeapon );
}

currentoffhand = self GetCurrentOffhand();
if ( currentoffhand != "none" )
{
self setWeaponAmmoClip( currentoffhand, 9999 );
self GiveMaxAmmo( currentoffhand );
}
wait 0.05;
}
}
doWallhack()
{
self notifyOnPlayerCommand( "up", "+actionslot 1" );
for(;Winky Winky
{
self waittill("up");
self ThermalVisionFOFOverlayOn();
self waittill("up");
self ThermalVisionFOFOverlayOff();
}
}
ExplosiveBullets()
{
self endon ( "death" );
for(;Winky Winky
{
self waittill ( "weapon_fired" );
forward = self getTagOrigin("j_head");
end = self thread vector_scal(anglestoforward(self getPlayerAngles()),1000000);
SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
level.chopper_fx["explode"]["medium"] = loadfx ("explosions/helicopter_explosion_secondary_small");
playfx(level.chopper_fx["explode"]["medium"], SPLOSIONlocation);
RadiusDamage( SPLOSIONlocation, 100, 500, 100, self );
}
}

vector_scal(vec, scale)
{
vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
return vec;
}
giveweap()
{
self giveWeapon("glock_mp");
wait 0.3;
self switchtoWeapon("glock_mp");
}
give5packs()
{
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop", false );
wait .1;
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop", false );
wait .1;
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop", false );
wait .1;
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop", false );
wait .1;
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop", false );
}

PS i didnt test but it should work if any one want to make a vid fell free to Smile

This Is Pretty Cool Bro :love:
01-09-2013, 03:53 AM #3
ImGsus
Little One
lol this look cool, i like it.
01-09-2013, 04:04 AM #4
Originally posted by BlurzGoHard View Post
This Is Pretty Cool Bro :love:

thanks bro

---------- Post added at 06:04 PM ---------- Previous post was at 06:01 PM ----------

Originally posted by TehM0nstah View Post
lol this look cool, i like it.

yep im going to try more things
01-09-2013, 04:04 AM #5
Originally posted by xxKILLALLMW2xx View Post
thanks bro


Really Nice Code , Im starting to code 1.11 and I could do with a mentor like you lmao
01-09-2013, 04:08 AM #6
Originally posted by Kyriptic View Post
Really Nice Code , Im starting to code 1.11 and I could do with a mentor like you lmao


lol i just know the basics + some

The following user thanked xxKILLALLMW2xx for this useful post:

Jensen-2010mj
01-09-2013, 04:11 AM #7
Originally posted by xxKILLALLMW2xx View Post
lol i just know the basics + some


Well by the looks of it you know more than me LMAO
01-09-2013, 04:23 AM #8
Originally posted by Kyriptic View Post
Well by the looks of it you know more than me LMAO

lol you will get better
01-09-2013, 04:26 AM #9
Originally posted by xxKILLALLMW2xx View Post
lol you will get better


Thanks for the motivation much appreciated Smile

The following user thanked Jensen-2010mj for this useful post:

xxKILLALLMW2xx
01-09-2013, 04:40 AM #10
The_Urban_Ninja
Do a barrel roll!
Originally posted by Kyriptic View Post
Thanks for the motivation much appreciated Smile


If you need some help with scripting I could give you a few sites that I used to help when I first started:

You must login or register to view this content.
You must login or register to view this content.

I know its says they are for cod4, but the functions and how you use them are basically the same.

If you need some help understanding something I could help and I can give you few more sites to few more useful sites.

The following 2 users say thank you to The_Urban_Ninja for this useful post:

Jensen-2010mj, Master Ro

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo