Metro Police ai request

hi i was wondering if anyone could make metro police ai from the begining of half life 2… but in a different npc or snpc (so it doesnt overwrite anything) and the ai from the begining i mean like he’ll walk around and if you get to close he’ll hit you or give you a first warning second warning and then moves in. also is it posible for some one to make ai so that npc’s call back-up like if theres metro police (lets say on construct) in the brown building and you hit a cop near the water could call the ones from the brown building and they’ll go?

i still don’t get it (what cmd u put in the console)

You don’t use the frakkin’ console!!!

oh, it autostarts?

No, you have to put it in a lua file.


so id have to put this
local ent = ents.Create( “env_global” );
ent:SetKeyValue( “initialstate”, 1 );
ent:SetKeyValue( “globalstate”, “gordon_precriminal” );
ent:Fire( “TurnOn”, 0 );
in a lua file? and if so how? and is there a specific file or do i make one and if i have to make one…once again how ?

found it in an old OLD OLD thread.

how do i save it as a lua

Type .lua instead of .txt at the end of the filename.

Sigh, when will they learn :effort:

(User was banned for this post ("Why reply?" - mahalis))

Can someone tell me how you can make a civil protection unit defend a area? ai_goal_police or something like thta, I can’t make it work.

Map triggers.

You have to spawn the ai goal and give it a targetname, then fire the right input with the right name on the metrocop. (I don’t know the input off the top of my head)

ok i read this on that thread and it says “only needs to be done once permap load” by that you mean put something in console?

Okay, thanks. :slight_smile: I could be doing it wrong because i’m using console commands.
While we’re on the subject, is it possible to make them pick up weapons off the floor?

You do not use the Console, you use LUA! And did you people not finish reading that entire post? You’re supposed to save the LUA as cp_chasedisabled.lua and in console in game you type “cp_chasedisabled 1” to activate the behavior.

oh ok thanks and also for the picking up weapons i think they automaticly do that…rebels do not sure about cp’s

Okay, thanks. :slight_smile:

mental note: must learn LUA