I've got an event set up that triggers when a unit enters the area in question and then runs a Lua script as its action. The event does trigger, so I've got that set up correctly, but the unit is not removed.
Specifically, my script is:
Code: Select all
unit = ScenEdit_UnitX()
ScenEdit_MsgBox('Test 1' .. unit.name .. unit.guid, 1)
if (string.find(unit.name, 'EW')) then
ScenEdit_MsgBox('Test 2 ' .. unit.name, 1)
if (ScenEdit_KillUnit(unit)) then
ScenEdit_MsgBox('Test 3 ' .. unit.name, 1)
ScenEdit_SetScore('NATO',ScenEdit_GetScore ('NATO')-20,'Chinese Ship Reached Taiwanese Landing Zone')
ScenEdit_MsgBox('Test 4 ' .. unit.name, 1)
else
ScenEdit_MsgBox('Test error ' .. _errmsg_, 1)
end
endWhen the unit enters the target area I get popup boxes for "Test 1" and "Test 2" but nothing else.
Any thoughts?

