UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Teleport zombies

broken avatar :(
Created 10 years ago
by Doodles_Inc
0 Members and 1 Guest are viewing this topic.
2,262 views
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 20 April 2016
Last active: 4 years ago
Posts
145
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
if I surprised you, you had underestimated me
Signature
if I surprised you, it was because you underestimated me
×
Doodles_Inc's Groups
Doodles_Inc's Contact & Social LinksDoodles_IncdoodlescriminoserDoodlesInc
How can I make that when zombies reach a trigger they teleport to somewhere that I want???
Thanks.
Marked as best answer by Doodles_Inc 9 years ago
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 4 November 2016
Last active: 9 years ago
Posts
11
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
cronex's Groups
cronex's Contact & Social Links
broken avatar :(
×
broken avatar :(
Location: at
Date Registered: 26 November 2016
Last active: 8 years ago
Posts
45
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Signature
12 year old music critic, quadrasexual Minecrafter, Linkin Park fan, Hentai enthusiast, intelligent atheist and vegan.
×
Cxwh's Groups
Cxwh's Contact & Social LinksCxwhModsGodAspire
If you don't want to do this with zones, I'm sure you can do something like this:
Code Snippet
Plaintext
function tp_near_trigger()
{
trigger = GetEnt("NAME OF THE TRIGGER", "targetname");
origin = trigger.origin;

range = 50;
rangeSQ = range**2; //Since we're using distanceSquared

AI = GetAITeamArray("axis");
for(i = 0; i < AI.size; i++)
{
if(isDefined(AI[i].is_brutus))
continue;

if(isDefined(AI[i]) && isAlive(AI[i]))
{
if(DistanceSquared(origin, AI[i].origin) <= rangeSQ)
AI[i] SetOrigin(DESTINATION ORIGIN);
}
}
}
I didn't test this I just though, but you should be able to see what I mean.

Cronex's way is great too

Double Post Merge: December 02, 2016, 06:53:48 pm
Sorry for my typos (not in the code) lol
Last Edit: December 02, 2016, 06:53:48 pm by Cxwh
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 20 April 2016
Last active: 4 years ago
Posts
145
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
if I surprised you, you had underestimated me
×
Doodles_Inc's Groups
Doodles_Inc's Contact & Social LinksDoodles_IncdoodlescriminoserDoodlesInc
If you don't want to do this with zones, I'm sure you can do something like this:
Code Snippet
Plaintext
function tp_near_trigger()
{
trigger = GetEnt("NAME OF THE TRIGGER", "targetname");
origin = trigger.origin;

range = 50;
rangeSQ = range**2; //Since we're using distanceSquared

AI = GetAITeamArray("axis");
for(i = 0; i < AI.size; i++)
{
if(isDefined(AI[i].is_brutus))
continue;

if(isDefined(AI[i]) && isAlive(AI[i]))
{
if(DistanceSquared(origin, AI[i].origin) <= rangeSQ)
AI[i] SetOrigin(DESTINATION ORIGIN);
}
}
}
I didn't test this I just though, but you should be able to see what I mean.

Cronex's way is great too

Double Post Merge: December 02, 2016, 06:53:48 pm
Sorry for my typos (not in the code) lol
Thanks.

Double Post Merge: December 03, 2016, 06:53:50 pm
you can use this Thread :
https://ugx-mods.com/forum/index.php/topic,14009.msg144108.html#msg144108
Thanks.

 
Loading ...