Post: [Script] Portal 2 Teleporter Gun
09-30-2012, 05:26 AM #1
ICS Vortex
Between Light and Lies
(adsbygoogle = window.adsbygoogle || []).push({}); I found this code floating around the internet, and I saw it hadn't been released on here. I've tested this code, and it's really fun. It's something different.

Add this to onPlayerSpawned():
    
self.TeleportCooling = 0;


Call it like this:
    
::TeleGun


Add this anywhere:
    
TeleGun()
{
self endon("disconnect");
self endon("death");
wait 1;
self thread maps\mp\gametypes\_hud_message::hintMessage( "^1[{+speed_throw}] is going ^2to" );
wait 2;
self thread maps\mp\gametypes\_hud_message::hintMessage( "^1[{+attack}] is going ^2from" );
self iPrintln( "^1Portal Gun Gave" );
self giveWeapon("spas12_grip_silencer_mp", 7, false );
self switchToWeapon("spas12_grip_silencer_mp", 7, false );
self thread DestroyPortalsOnDeath();
self thread MonitorTeleportCooling();

for(;Winky Winky
{
if (self AttackButtonPressed() && self getCurrentWeapon() == "spas12_grip_silencer_mp")
{
self notify("Portal1Death");
if (isDefined(self.Portal1))
self.Portal1 Delete();

self thread CreatePortal1();
wait .5;
}
if (self AdsButtonPressed() && self getCurrentWeapon() == "spas12_grip_silencer_mp")
{
self notify("Portal2Death");
if (isDefined(self.Portal2))
self.Portal2 Delete();

self thread CreatePortal2();
wait .5;
}
wait .05;
}
}

CreatePortal1()
{
self endon("disconnect");
self endon("death");
self endon("Portal1Death");

self.Portal1 = SpawnFx( level.spawnGlow["friendly"], GetCursorPos() );
TriggerFx( self.Portal1 );

for(;Winky Winky
{
foreach(player in level.players)
{
if(Distance(self.Portal1.origin,player.origin) < 50 && player.TeleportCooling == 0)
{
player SetOrigin(self.Portal2.origin);
player.TeleportCooling = 20;
wait .5;
}
}
wait .05;
}
}

CreatePortal2()
{
self endon("disconnect");
self endon("death");
self endon("Portal2Death");

self.Portal2 = SpawnFx( level.spawnGlow["enemy"], GetCursorPos() );
TriggerFx( self.Portal2 );

for(;Winky Winky
{
foreach(player in level.players)
{
if(Distance(self.Portal2.origin,player.origin) < 50 && player.TeleportCooling == 0)
{
player SetOrigin(self.Portal1.origin);
player.TeleportCooling = 20;
wait .5;
}
}
wait .05;
}
}

MonitorTeleportCooling()
{
self endon("disconnect");
self endon("death");

for(;Winky Winky
{
foreach(player in level.players)
{
if (player.TeleportCooling > 0)
player.TeleportCooling--;
}
wait .1;
}
}

DestroyPortalsOnDeath()
{
self endon("disconnect");
self waittill("death");
self notify("Portal1Death");
self notify("Portal2Death");
self.Portal1 Delete();
self.Portal2 Delete();
}


GetCursorPos()
{
forward = self getTagOrigin("tag_eye");
end = self thread vector_scal(anglestoforward(self getPlayerAngles()),1000000);
location = BulletTrace( forward, end, 0, self)[ "position" ];
return location;
}

vector_scal(vec, scale)
{
vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
return vec;
}


Video:


Credits:
OwnedTom (original script)
ICS Vortex (me - modified script)

*You also get to see an early sneak peek at my new patch :fa:
(adsbygoogle = window.adsbygoogle || []).push({});

The following 6 users say thank you to ICS Vortex for this useful post:

BvB-09r-_-N!c0, CrEaTiiOnUNREAL, KCxFTW, Kitty=^.^=, Sirprizer, The Foo

The following user groaned ICS Vortex for this awful post:

OmGRhys-x
10-07-2012, 03:11 PM #11
OmGRhys-x
Are you high?
Originally posted by ICS
I found this code floating around the internet, and I saw it hadn't been released on here. I've tested this code, and it's really fun. It's something different.

Add this to onPlayerSpawned():
    
self.TeleportCooling = 0;


Call it like this:
    
::TeleGun


Add this anywhere:
    
TeleGun()
{
self endon("disconnect");
self endon("death");
wait 1;
self thread maps\mp\gametypes\_hud_message::hintMessage( "^1[{+speed_throw}] is going ^2to" );
wait 2;
self thread maps\mp\gametypes\_hud_message::hintMessage( "^1[{+attack}] is going ^2from" );
self iPrintln( "^1Portal Gun Gave" );
self giveWeapon("spas12_grip_silencer_mp", 7, false );
self switchToWeapon("spas12_grip_silencer_mp", 7, false );
self thread DestroyPortalsOnDeath();
self thread MonitorTeleportCooling();

for(;Winky Winky
{
if (self AttackButtonPressed() && self getCurrentWeapon() == "spas12_grip_silencer_mp")
{
self notify("Portal1Death");
if (isDefined(self.Portal1))
self.Portal1 Delete();

self thread CreatePortal1();
wait .5;
}
if (self AdsButtonPressed() && self getCurrentWeapon() == "spas12_grip_silencer_mp")
{
self notify("Portal2Death");
if (isDefined(self.Portal2))
self.Portal2 Delete();

self thread CreatePortal2();
wait .5;
}
wait .05;
}
}

CreatePortal1()
{
self endon("disconnect");
self endon("death");
self endon("Portal1Death");

self.Portal1 = SpawnFx( level.spawnGlow["friendly"], GetCursorPos() );
TriggerFx( self.Portal1 );

for(;Winky Winky
{
foreach(player in level.players)
{
if(Distance(self.Portal1.origin,player.origin) < 50 && player.TeleportCooling == 0)
{
player SetOrigin(self.Portal2.origin);
player.TeleportCooling = 20;
wait .5;
}
}
wait .05;
}
}

CreatePortal2()
{
self endon("disconnect");
self endon("death");
self endon("Portal2Death");

self.Portal2 = SpawnFx( level.spawnGlow["enemy"], GetCursorPos() );
TriggerFx( self.Portal2 );

for(;Winky Winky
{
foreach(player in level.players)
{
if(Distance(self.Portal2.origin,player.origin) < 50 && player.TeleportCooling == 0)
{
player SetOrigin(self.Portal1.origin);
player.TeleportCooling = 20;
wait .5;
}
}
wait .05;
}
}

MonitorTeleportCooling()
{
self endon("disconnect");
self endon("death");

for(;Winky Winky
{
foreach(player in level.players)
{
if (player.TeleportCooling > 0)
player.TeleportCooling--;
}
wait .1;
}
}

DestroyPortalsOnDeath()
{
self endon("disconnect");
self waittill("death");
self notify("Portal1Death");
self notify("Portal2Death");
self.Portal1 Delete();
self.Portal2 Delete();
}


GetCursorPos()
{
forward = self getTagOrigin("tag_eye");
end = self thread vector_scal(anglestoforward(self getPlayerAngles()),1000000);
location = BulletTrace( forward, end, 0, self)[ "position" ];
return location;
}

vector_scal(vec, scale)
{
vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
return vec;
}


Video:


Credits:
OwnedTom (original script)
ICS Vortex (me - modified script)

*You also get to see an early sneak peek at my new patch :fa:



This is so old had this is my patch for months and months :L

The following user thanked OmGRhys-x for this useful post:

YouAppreciateMe
10-07-2012, 06:54 PM #12
ICS Vortex
Between Light and Lies
Originally posted by x View Post
This is so old had this is my patch for months and months :L


"I found this code floating around the internet, and I saw it hadn't been released on here. I've tested this code, and it's really fun. It's something different."

It's not been released on here.
10-08-2012, 04:58 AM #13
how do you add it ?
10-08-2012, 07:46 AM #14
OmGRhys-x
Are you high?
Originally posted by ICS
"I found this code floating around the internet, and I saw it hadn't been released on here. I've tested this code, and it's really fun. It's something different."

It's not been released on here.


yes it has i got the code of NGU LOL
10-08-2012, 11:37 AM #15
ICS Vortex
Between Light and Lies
Originally posted by x View Post
yes it has i got the code of NGU LOL


Link please?
10-08-2012, 01:23 PM #16
OmGRhys-x
Are you high?
Originally posted by ICS
Link please?


Found this 1 You must login or register to view this content.
but there is another 1 cba 2 find that 1 aswell :L
10-08-2012, 08:36 PM #17
ICS Vortex
Between Light and Lies
Originally posted by x View Post
Found this 1 You must login or register to view this content.
but there is another 1 cba 2 find that 1 aswell :L


Shat.
I'm going to leave this up anyways. I haven't saw it on here recently, so I'll leave it up for anyone who needs it. It's been since 2011 that it's been posted :fa:
10-10-2012, 12:22 AM #18
Originally posted by Youngter321 View Post
how do you add it ?

LOL! No
10-10-2012, 12:48 AM #19
Originally posted by CrEaTiiOnUNREAL View Post
LOL! No


what? im just asking..

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo