Building A) Automatic win for the attacking team.
Building B) Subtract 10 reinforcments from the defending team.
I have attempted the reinforcements thing but it didn't work.
LUA
Help please.
Moderator: Moderators


But your supposed Then statements are correct. Also, your first scenario would follow the same format but just with a different outcome. The outcome would be an instant victory for a particular team, so use the function:
Code: Select all
MissionVictory("[insert-team-name]")

The bolded is the If statement, and you don't even need to change it to serve your purpose here, aside from putting the actual name of the object. OnObjectKill is the event that happens to object, which also doesn't change, because that's what you want to happen; you want this object to be destroyed in order for something, the Then statement(s), to occur. For more events see the shipped document entitled Battlefront2_scripting_system.doc. Animateobja is just a variable and can be anything you want, but it should be unique per function. And then the following is what happens once the specified object is destroyed in the above example:Maveritchell wrote:animateobja = OnObjectKill(
function(object, killer)
if GetEntityName(object) == "objectBnameinZeroEditor" then
PlayAnimation("whateveranimationgroup")
end
end
)
Code: Select all
PlayAnimation("whateveranimationgroup")

And you don't need those brackets around REP. The brackets were just part of the placeholder I used, not part of the function itself.AQT wrote:...but it should be unique per function.


