Running a Script That Causes A WIN
So I'm trying to run a script that causes the activity to make you win once the actor it's attached to spawns into the scene out of a dropship/rocket. Right now I've got this...
Code:
function Create(self)
self.winTimer = Timer();
end
function Update(self)
if self.winTimer:IsPastSimMS(150) then
if self.CPUTeam == Activity.NOTEAM then
if self.playertally == 1 then
for i = 1, #self.playerlist do
if self.playerlist[i] == true then
self.WinnerTeam = i;
ActivityMan:EndActivity();
end
end
end
else
if self.playertally == 0 then
self.WinnerTeam = self.CPUTeam;
ActivityMan:EndActivity();
end
end
end
end
...attached to a Coalition Light. It's slightly altered from the skirmish defence win/lose conditions code. Right now it doesn't do anything. I was hoping for some guidance in the right direction!