Code: Select all
animateobja = OnObjectKill(
function(object, killer)
if GetEntityName(object) == "objectBnameinZeroEditor" then
PlayAnimation("whateveranimationgroup")
end
end
)
Edit: And here's that part about giving points when you kill an object:
Code: Select all
killobjc = OnObjectKill(
function(object, killer)
if killer and IsCharacterHuman(killer) and GetEntityName(object) == "objectbeingkillednameinZeroEditor" then
AddAssaultDestroyPoints(killer)
end
end
)
That first part ("killobjc") is the variable name assigned to this event. It can be whatever (unrelated) name you want, so long as you don't use the same name for another event or variable. The line "if...etc." is the conditional statement for giving points. "if killer" is checking to see whether the killer exists. Always add this before you add the line IsCharacterHuman(killer), to prevent crashes if a human kills themselves. "IsCharacterHuman(killer)" checks to see whether the killer was human. This way only humans will recieve points for killing the object. Remove this if you want. The last part of the if statement checks to make sure that the object-being-killed's "name" matches the name you assigned in ZE. This is not the name of the .odf, but the name you assigned in ZE. Sometimes they are the same but not always.