AI Deathregions
Posted: Wed Feb 11, 2009 5:18 pm
Alright, I set up these regions on my map where I want AI dead if they stray into them. They don't seem to be working at all. I double-checked that the regions were in the correct layer, etc. My code in the LUA:
ActivateRegion("ai1")
OnEnterRegion(
function(regIn, character)
if not IsCharacterHuman(character) then
KillObject(character)
end
end,
"ai1"
)
Why isn't this working? Everything looks to be without errors and typos to me. Or...is there a simpler way to set up a region that only kills AI and not humans?
ActivateRegion("ai1")
OnEnterRegion(
function(regIn, character)
if not IsCharacterHuman(character) then
KillObject(character)
end
end,
"ai1"
)
Why isn't this working? Everything looks to be without errors and typos to me. Or...is there a simpler way to set up a region that only kills AI and not humans?