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 ???
Regions and LUA
Moderator: Moderators
- Lorul1
- Rebel Colonel

- Posts: 562
- Joined: Wed Apr 24, 2013 10:34 pm
- Projects :: Assault on Theed
- xbox live or psn: No gamertag set
- Location: Your House
-
Marth8880
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: Regions and LUA
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)
)- Lorul1
- Rebel Colonel

- Posts: 562
- Joined: Wed Apr 24, 2013 10:34 pm
- Projects :: Assault on Theed
- xbox live or psn: No gamertag set
- Location: Your House
Re: Regions and LUA
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
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
-
Marth8880
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: Regions and LUA
DeactivateRegion("regionname") and ActivateRegion("regionname") might work. No promises, though.
