I have two scripts that are supposed to work together to determine the frozen player. (They communicate by changing their names)
script 1:
_G.scriptperson2 = script.Parent.gamelogic
function display(text)
local text2 = game.ServerStorage.text.Value
text2 = text
wait(3)
text2 = ""
end
while true do
repeat wait() until _G.scriptperson.Name == "ready"
repeat wait() until _G.Team2Player.Character.ingame.WalkSpeed == 0
wait(3)
if _G.scriptperson2.Name ~= "checkdone" then
script.Name = "checkdone"
_G.scriptperson2.Disabled = true
for i,v in pairs(game.Players:GetChildren()) do
if v.TeamColor == "Bright blue" then
v.leaderstats.Wins.Value = v.leaderstats.Wins.Value + 1
end
end
display("Red captain has been frozen! Blue team wins!")
script.Name = "gamedone"
wait(1)
script.Name = "gamelogic2"
_G.scriptperson2.Disabled = false
elseif _G.scriptperson2.Name == "checkdone" then return end
end
script 2:
_G.scriptperson3 = script.Parent.gamelogic2
function display(text)
local text2 = game.ServerStorage.text.Value
text2 = text
wait(3)
text2 = ""
end
while true do
repeat wait() until _G.scriptperson.Name == "ready"
repeat wait() until _G.Team1Player.Character.ingame.WalkSpeed == 0
if _G.scriptperson3.Name ~= "checkdone" then
_G.scriptperson3.Disabled = true
script.Name = "checkdone"
for i,v in pairs(game.Players:GetChildren()) do
if v.TeamColor == "Bright red" then
v.leaderstats.Wins.Value = v.leaderstats.Wins.Value + 1
end
end
display("Blue captain has been frozen! Red team wins!")
script.Name = "gamedone"
wait(1)
script.Name = "gamelogic"
_G.scriptperson3.Disabled = false
elseif _G.scriptperson3.Name == "checkdone" then return end
end
For the most part, they work perfectly, the check for the names of the other scripts and change their own names accordingly, but one thing is wrong! It skips the entire block of each code that goes:
for i,v in pairs(game.Players:GetChildren()) do
if v.TeamColor == "Bright red" then
v.leaderstats.Wins.Value = v.leaderstats.Wins.Value + 1
end
end
display("Blue captain has been frozen! Red team wins!")
Why does it do this? Neither of the scripts break. They keep looping the way they are supposed to, it just skips the block above in each of them.

5 comments
Does" v.TeamColor" need to be checked against a color3 value or a brick color value?
I think it's a brick color.
Maybe 'TeamColor.name == "Bright red"'
Golden was right about it needing to be a BrickColor value. Change it to v.TeamColor = BrickColor.new("Bright red")
Ok thanks guys!