of     1   

CyberNugget
#139867430Thursday, July 10, 2014 12:35 PM GMT

I'm trying to get my game to end when all of the survivors have died, I've used this code but it only works when the value is set to > 0. function CheckTeam() for CheckDead = 1,#Game.Players:GetPlayers() do --Starts checking for alive players Survivors = 0 if Game.Players:GetPlayers()[CheckDead].TeamColor == BrickColor.new("Deep blue") then Survivors = Survivors + 1 end if Survivors < 0 then print("Players are dead!") msg = Instance.new("Message",Workspace) msg.Text = "Players are dead" wait(4) msg:Destroy() end end end
AnonyAnonymous
#139867894Thursday, July 10, 2014 12:46 PM GMT

Alive = {} Dead = {} if #Alive == 0 and #Dead > 0 then print("Noone wins!") end
CyberNugget
#139869987Thursday, July 10, 2014 1:31 PM GMT

Only gave me another error 14:31:35.864 - Workspace.Scripts.MainGame.Main Script:6: attempt to perform arithmetic on global 'Alive' (a table value)
AnonyAnonymous
#139870355Thursday, July 10, 2014 1:39 PM GMT

How are you implementing it into your script?.
CyberNugget
#139987365Friday, July 11, 2014 3:09 PM GMT

function CheckTeam() for CheckDead = 1,#Game.Players:GetPlayers() do --Starts checking for alive players Survivors = {} if Game.Players:GetPlayers()[CheckDead].TeamColor == BrickColor.new("Deep blue") then Survivors = Survivors + 1 end if #Survivors == 0 then print("Players are dead!") msg = Instance.new("Message",Workspace) msg.Text = "Players are dead" wait(4) msg:Destroy() end end end

    of     1