This script is what makes my terminal run, I made it for one place and it works fine, but then I put it in another game of mine and it gets to the while wait(1) but it never goes into the for loop. I added some prints to see where it'd stop and it never gets to for i,v in pairs...
TimeLeft = script.Parent.TimeLeft Owner = script.Parent.Owner Cap = script.Parent.CapAmount term = script.Parent.CaptureThing while wait(1) do parttwo = term.B.Position partone = term.A.Position Region = Region3.new(partone,parttwo) r = 0 b = 0 for i,v in pairs(workspace:FindPartsInRegion3(Region,nil,100)) do if v.Parent:findFirstChild("Humanoid") then p = game.Players:GetPlayerFromCharacter(v.Parent) if p.TeamColor == BrickColor.new("Bright red") then r = r + 1 elseif p.TeamColor == BrickColor.new("Bright blue") then b = b + 1 end print(b) print(r) if b > r then if Cap.Value < 10 then Cap.Value = Cap.Value + 1 end if Cap.Value == 10 then Owner.Value = "SST" end elseif r > b then if Cap.Value > 0 then Cap.Value = Cap.Value - 1 end if Cap.Value == 0 then Owner.Value = "Raiders" end end end end end
Only output I get is the prints when I put them in, I put a print before the for loop, and one right at the start of the for loop, the one before prints, the one inside does not. Like I said this works in my other place, but not my second one.