Code: Select all
OnObjectDamage(
function(object, damager)
if GetCharacterTeam(player) == DEF then
if GetCharacterClass(damager) == 2 then
SetProperty (damager, "AddHealth", 20)
end
end
end
)
Unit damages another unit
Damager, if it is a certain certain class and it is the defender team, recieves 20 health
It should be simple but the above code is generating the below error:
Code: Select all
Message Severity: 2
.\Source\LuaCallbacks_Mission.cpp(635)
Entity "0" not foundIf you help me your name will be added to the readme of the map that this code goes in,
which should be released before Christmas.
Thanks,
-Saitek
And just for the record we need an LUA forum

