Post reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Name:
Email:
Subject:
Message icon:

Verification:

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: Frindow
« on: June 18, 2020, 04:29:13 pm »

I am trying to make it so when there are 2 people left in a match the game will end. But, I ran into an issue. When there are no players on the team it runs the script. It does not have anything to do with the else.

Code: [Select]
while true do   
wait()
    t = game:GetService("Teams"):GetChildren()
    for i,v in ipairs(t) do
        if v.Name ~= "Playing" then
            local playerAmount = v:GetPlayers()
       for playersAmount,_ in ipairs(playerAmount) do
       if playerAmount == 2 then

else
game.StarterGui.GameGUI.Status.Text = "Game Over!"
game.Workspace.Plate.BrickColor = BrickColor.new("Really red")
game.Workspace.Plate.Transparency = 0.1
wait(0.1)
game.Workspace.Plate.Transparency = 0.2
wait(0.1)
game.Workspace.Plate.Transparency = 0.3
wait(0.1)
game.Workspace.Plate.Transparency = 0.4
wait(0.1)
game.Workspace.Plate.Transparency = 0.5
wait(0.1)
game.Workspace.Plate.Transparency = 0.6
wait(0.1)
game.Workspace.Plate.Transparency = 0.7
wait(0.1)
game.Workspace.Plate.Transparency = 0.8
wait(0.1)
game.Workspace.Plate.Transparency = 0.9
wait(0.1)
game.Workspace.Plate.Transparency = 1
game.Workspace.Plate.CanCollide = false
script.Disabled = true    
end
end
end
end
end

Please help!