Page 1 of 1

Regions and LUA

Posted: Sun Apr 06, 2014 5:40 pm
by Lorul1
I have found my self wanting to edit regions through lua for a while, multipul times...

I have a danger regiond and shadow regiond I would like to remove after taking a command post over for team 1.

Is ths even posible ???

Re: Regions and LUA

Posted: Sun Apr 06, 2014 5:58 pm
by Marth8880
Certainly. :0

Code: Select all

	OnFinishCaptureTeam(
		function(cPost)
			local pName = GetEntityName(cPost)	-- gets the name of the post that was captured
			
			if pName == "cpname" then	-- change "cpname" to the name of the post that was captured
				RemoveRegion("regionname")	-- change "regionname" to the name of the region that will be deleted
			end
		end,
		1 -- team ID who captured the CP (can also be ATT/DEF or ALL/CIS/IMP/REP)
	)

Re: Regions and LUA

Posted: Sun Apr 06, 2014 10:16 pm
by Lorul1
Cool thanks ...

But just so I don't have to make another post -

Is there a way that I can disable or turn off a region then turn it on. I know you can do this with death regionds but I'm talking about other regiond like shadow and danger regions

Re: Regions and LUA

Posted: Sun Apr 06, 2014 10:18 pm
by Marth8880
DeactivateRegion("regionname") and ActivateRegion("regionname") might work. No promises, though.