DIR Return Create A Forum - Home
---------------------------------------------------------
Scripting Help
HTML https://scriptinghelp.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: Questions
*****************************************************
#Post#: 41--------------------------------------------------
Help With Debugging [Solved]
By: CheckeredDev Date: June 18, 2020, 3:29 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 [tt]else[/tt].
[code]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
[/code]
Please help!
*****************************************************