I have a script that detects a change in a String Value called GameStatus. The change isn't the problem. The script checks the value of the string value for if it's a certain string and then runs a set of code indented.
The problem has been highlighted in comments.
local GameStatus = workspace.GameStatus
local HeadingCountdown = workspace.HeadingCountdown
local IntermissionTime = 30
local PlottingTime = 60
local PlotEvent = workspace.PlotEvent
local Players = game.Players
local TotalPlayers = Players:GetChildren()
GameStatus.Changed:Connect(function()
if GameStatus.Value == "Intermission" then
for i = IntermissionTime,0,-1 do --30 being the main value
HeadingCountdown.Value = i
print(i)
wait(1)
end
GameStatus.Value = "Plotting"
print(GameStatus,"is",GameStatus.Value,"on script")
elseif GameStatus.Value == "Plotting" then
print("WE GOT IT")
PlotEvent:FireAllClients()
for i = PlottingTime,0,-1 do
HeadingCountdown.Value = i
print(i)
wait(1)
end
print("starting count")
wait(3)
----------------------------------------------------------------------PROBLEM
for i,n in pairs(TotalPlayers) do
print(TotalPlayers[n],"is up!")
if n.Backpack.FinishedPlot.Value == true then
print(TotalPlayers[n],"is true!")
n.Team = game.Teams.Playing
print(TotalPlayers[n],"is playing!")
else
print(TotalPlayers[n],"isn't true.")
n.Team = game.Teams.Spectating
print(TotalPlayers[n],"won't be playing with us today.")
end
end
----------------------------------------------------------------------PROBLEM
end
end)
It also does not give back any error at all. I knew something was wrong when my team did not change. So I added prints to debug it, but none ended up showing, like the script had just full stopped in the middle of it.
