Post: Fly Trap / Thundergun Trap Codes
05-28-2011, 06:43 PM #1
Hawkin
Lord of the Undead
(adsbygoogle = window.adsbygoogle || []).push({}); Here is the codes for my Fly Trap or Thundergun Trap whatever you want to call it. It works on COD4 and should work on MW2 as is. For WAW you would have to change one effect. To place a Trap just use this line to call it.
    self thread FLBuy();


    FLBuy()	
{
self iPrintlnBold("^2Trap Placed.");
owner = self;
self thread FLTrap(owner);
}
FLTrap(owner)
{ tr = spawn("script_model", owner.origin );
tr setModel("weapon_c4_mp");
tr.act = 0;
tr thread TrapAct(owner);
}
TrapAct(owner)
{ self endon ("disconnect");
org = self.origin;
fxc4 = SpawnFx(level.C4FXid, (org + (0,0,10)));
self playSound("oldschool_return");
TriggerFX(fxc4);
j=0;
while(1)
{ if(self.act == 0)
{ for ( i = 0; i < level.players.size; i++ )
{ p = level.players[i];
if(p.team != owner.team)
{ if(Distance(org, p.origin) < 120)
{ if(isAlive(p))
{ p thread TrapMove(owner);
self.act = 1;
}
}
}
}
}
if(self.act == 1)
{ fxti = SpawnFx(level.fxxx1, org);
fxti.angles = (270,0,0);
earthquake( 0.8, 0.5, org, 300 );
self playSound( "fast_artillery_round" );
TriggerFX(fxti);
wait .8;
fxc4 delete();
fxti delete();
self.act = 2;
}
if(self.act == 2)
{ j++;
if(j>100)
{ self playSound("oldschool_return");
fxc4 = SpawnFx(level.C4FXid, (org + (0,0,10)));
TriggerFX(fxc4);
self.act=0;
j=0;
}
}
wait .2;
}
}
TrapMove(owner)
{ self endon ("disconnect");
self endon ("death");
vec = anglestoforward(self getPlayerAngles());
fvec = (vec[0] * -1000, vec[1] * -1000, 1000);
if(isdefined(self.N)) self.N delete();
self.N = spawn("script_origin", self.origin);
self linkto(self.N);
self.N MoveGravity( fvec, 2.5 );
wait 2.5;
self playSound( "artillery_impact" );
self unlink();
owner.kills++;
owner.score += 50;
self suicide();
}
(adsbygoogle = window.adsbygoogle || []).push({});
05-28-2011, 06:49 PM #2
MeowDev
Power to the Premium
Nice, you should do a megathread Smile

The following user thanked MeowDev for this useful post:

Hawkin

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo