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

1 comment
Are you getting any Output at all? I can't see why this wouldn't work, unless you misnamed some Values.