Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Okay its a bit more than i thought first hehe
- -- These 2 variables can be put somewhere but at best in no function
- T1LooseCounter = 0
- T2LooseCounter = 0
- -- A new function put it somewhere ( you can also put the soviet and allies call in if you want to )
- SetupPlayers = function()
- Multi0 = Player.GetPlayer("Multi0")
- if Multi0 ~= nil then
- WinTheGame1 = Multi0.AddPrimaryObjective("Kill all enemys!")
- else
- T1LooseCounter = T1LooseCounter +1
- end
- Multi1 = Player.GetPlayer("Multi1")
- if Multi1 ~= nil then
- WinTheGame2 = Multi1.AddPrimaryObjective("Kill all enemys!")
- else
- T1LooseCounter = T1LooseCounter +1
- end
- Multi2 = Player.GetPlayer("Multi2")
- if Multi2 ~= nil then
- WinTheGame3 = Multi2.AddPrimaryObjective("Kill all enemys!")
- else
- T1LooseCounter = T1LooseCounter +1
- end
- Multi3 = Player.GetPlayer("Multi3")
- if Multi3 ~= nil then
- WinTheGame4 = Multi3.AddPrimaryObjective("Kill all enemys!")
- else
- T2LooseCounter = T2LooseCounter +1
- end
- Multi4 = Player.GetPlayer("Multi4")
- if Multi4 ~= nil then
- WinTheGame5 = Multi4.AddPrimaryObjective("Kill all enemys!")
- else
- T2LooseCounter = T2LooseCounter +1
- end
- Multi5 = Player.GetPlayer("Multi5")
- if Multi5 ~= nil then
- WinTheGame6 = Multi5.AddPrimaryObjective("Kill all enemys!")
- else
- T2LooseCounter = T2LooseCounter +1
- end
- end
- -- Just add this to your Worldloaded = function() at best at the top
- SetupPlayers()
- -- Just add this to your Tick = function()
- if Multi0 ~= nil and Multi0.HasNoRequiredUnits() and not P1Lost then
- P1Lost = true
- Multi0.MarkFailedObjective(WinTheGame1)
- T1LooseCounter = T1LooseCounter +1
- end
- if Multi1 ~= nil and Multi1.HasNoRequiredUnits() and not P2Lost then
- P2Lost = true
- Multi1.MarkFailedObjective(WinTheGame2)
- T1LooseCounter = T1LooseCounter +1
- end
- if Multi2 ~= nil and Multi2.HasNoRequiredUnits() and not P3Lost then
- P3Lost = true
- Multi2.MarkFailedObjective(WinTheGame3)
- T1LooseCounter = T1LooseCounter +1
- end
- if Multi3 ~= nil and Multi3.HasNoRequiredUnits() and not P4Lost then
- P4Lost = true
- Multi3.MarkFailedObjective(WinTheGame4)
- T2LooseCounter = T2LooseCounter +1
- end
- if Multi4 ~= nil and Multi4.HasNoRequiredUnits() and not P5Lost then
- P5Lost = true
- Multi4.MarkFailedObjective(WinTheGame5)
- T2LooseCounter = T2LooseCounter +1
- end
- if Multi5 ~= nil and Multi5.HasNoRequiredUnits() and not P6Lost then
- P5Lost = true
- Multi5.MarkFailedObjective(WinTheGame6)
- T2LooseCounter = T2LooseCounter +1
- end
- if T1LooseCounter == 3 then
- Team2Won()
- end
- if T2LooseCounter == 3 then
- Team1Won()
- end
- -- 2 seperate functions stand alone like SetupPlayers
- Team2Won = function()
- if not P4Lost then
- Multi3.MarkCompletedObjective(WinTheGame4)
- end
- if not P5Lost then
- Multi4.MarkCompletedObjective(WinTheGame5)
- end
- if not P6Lost then
- Multi5.MarkCompletedObjective(WinTheGame6)
- end
- end
- Team1Won = function()
- if not P1Lost then
- Multi0.MarkCompletedObjective(WinTheGame1)
- end
- if not P2Lost then
- Multi1.MarkCompletedObjective(WinTheGame2)
- end
- if not P3Lost then
- Multi2.MarkCompletedObjective(WinTheGame3)
- end
- end
Add Comment
Please, Sign In to add comment