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, 04:43 AM #11
Originally posted by Ninja View Post
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.


Thankyou bro this will surely help me Happy your a star
01-09-2013, 04:50 AM #12
The_Urban_Ninja
Do a barrel roll!
Originally posted by Kyriptic View Post
Thankyou bro this will surely help me Happy your a star


No problem + heres another good thing you can use.
You must login or register to view this content.
Some of the things are the same as the other site but you might be able to understand it better.

The following user thanked The_Urban_Ninja for this useful post:

xxKILLALLMW2xx
01-09-2013, 05:13 AM #13
Originally posted by Ninja View Post
No problem + heres another good thing you can use.
You must login or register to view this content.
Some of the things are the same as the other site but you might be able to understand it better.


Again thankyou :P
01-12-2013, 08:38 AM #14
This is actually pretty sick! I was going to make a custom weapon but I got bad syntax :(
Keep up the good work :love:

The following user thanked SUBARUDEMON for this useful post:

xxKILLALLMW2xx
01-12-2013, 02:42 PM #15
Originally posted by SUBARUDEMON View Post
This is actually pretty sick! I was going to make a custom weapon but I got bad syntax :(
Keep up the good work :love:


thanks man, just work at it you will get it bad syntax can be easy to fix like a ; is missing or a extra } is there
01-18-2013, 01:31 AM #16
    self setWeaponAmmoClip("usp_mp", 1);
self setWeaponAmmoStock("usp_mp", 0);

Fix bug by adding code above also updated thread with the fix
01-19-2013, 12:50 AM #17
sounds pretty cool
01-19-2013, 01:55 AM #18
Originally posted by Jackie70br View Post
sounds pretty cool

thanks thing in this can be switched out to just switch the self threads to different mods

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo