Page 1 of 1

AI Deathregions

Posted: Wed Feb 11, 2009 5:18 pm
by jangoisbaddest
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?

Re: AI Deathregions

Posted: Wed Feb 11, 2009 5:22 pm
by Fiodis
Not sure if it would do anything, but try moving the ActivateRegion line after the rest of the code. If I remember correctly, that was how you activated the regions for a teleporter. Might be the same here.