How I solucionate that?
My .lua:
Code: Select all
SetAIDifficulty(2, -8, "medium")
AllowAISpawn(ATT, false)
AllowAISpawn(DEF, true)
ScriptCB_SetGameRules("campaign")
onfirstspawn = OnCharacterSpawn(
function(character)
if character == 0 then
ShowPopup("level.geo1.hints.hints")
ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil
BeginObjectivesTimer()
ScriptCB_EnableCommandPostVO(0)
ShowMessageText("Text test", ATT)
end
end)
--objective :goto (mision I)
Objective1 = ObjectiveGoto:New{TeamATT = ATT, TeamDEF = DEF,
text = "Go to region", popupText = "Well done",
regionName = "goto", mapIcon = "hud_objective_icon_circle", AIGoalWeight = 0}
Objective1:AddHint("level.geo1.hints.movement")
Objective1:AddHint("level.geo1.hints.obj_markers")
Objective1:AddHint("level.geo1.hints.review_objectives")
Objective1:AddHint("level.geo1.hints.sprint")
Objective1.OnStart = function(self)
att_obj1_aigoal = AddAIGoal(ATT, "Deathmatch", 100)
def_obj1_aigoal = AddAIGoal(DEF, "Deathmatch", 100)
MapAddEntityMarker("hud_objective_icon", "hud_objective_icon_circle", 3.0, 1, "YELLOW", true)
end
Objective1.OnComplete = function(self)
DeleteAIGoal(att_obj1_aigoal)
DeleteAIGoal(def_obj1_aigoal)
ShowMessageText("game.objectives.complete", ATT)
MapRemoveEntityMarker("hud_objective_icon")
end
end
function BeginObjectivesTimer()
beginobjectivestimer = CreateTimer("beginobjectivestimer")
OnTimerElapse(BeginObjectives, beginobjectivestimer)
SetTimerValue(beginobjectivestimer, 4)
StartTimer(beginobjectivestimer)
end
function BeginObjectives()
objectiveSequence = MultiObjectiveContainer:New{delayVictoryTime = 4}
objectiveSequence:AddObjectiveSet(Objective1)
objectiveSequence:Start()
end