I made a game a while ago and was testing just fine for along time but I took a break and came back to it about a week ago and ever since then whenever I go into "Test" mode I get the error "timeout before resuming thread" on all my scripts. Whenever I go into play mode in studio it works just fine but whenever I add multiple people in test mode all of my scripts shut down and give me that same error. My scripts were working fine just fine but here is the Master script.
m = Instance.new("Message")
h = Instance.new("Hint")
m.Parent = game.Workspace
h.Parent = game.Workspace
players = game.Players:GetPlayers()
while true do if game.Players.NumPlayers >= 1 then
--m.Text = "Loading-Please wait."
wait(8)
Spawns = game.Workspace.Elevator.Spawns1:GetChildren()
Spawnz = game.Workspace.Spawns2:GetChildren()
--m.Text = "Teleporting to Elevator"
wait(4)
--Choosing roles
contestants = {players}
for _, players in pairs(game.Players:GetPlayers()) do
if players and players.Character then
local humanoid = players.Character:WaitForChild("Humanoid")
if humanoid and humanoid.Health > 0 then
table.insert(contestants, players)
end
end
end
Demon = players[math.random(1, #contestants)]
--while true do
randomplayer = players[math.random(1, #contestants)]
if randomplayer ~= Demon then
end
Hunter = randomplayer
wait(0.1)
--end
backpack = game.Players:FindFirstChild("Backpack")
if backpack then
if players == Demon then
local illuminati = game.ServerStorage.Knife:Clone()
illuminati.Parent = game.Players:FindFirstChild("StarterGear")
elseif players == Hunter then
local illuminboti = game.ServerStorage.RossRifle:Clone()
illuminboti.Parent = game.Players:FindFirstChild("StarterGear")
end
end
for i, v in pairs(game.Players:GetPlayers()) do
name = v.Name
check = game.Workspace:FindFirstChild(name)
if check then
checkHumanoid = check:FindFirstChild("Humanoid")
if checkHumanoid then
check:MoveTo(Spawns[i].Position)
end
end
end
--m.Text = "Game in progress"
wait(45)
for i, v in pairs(game.Players:GetPlayers()) do
if checkHumanoid then
check:MoveTo(Spawnz[i].Position)
end
end
--m.Text = "Round ended"
wait(5)
--m.Text = "Starting new round"
wait(5)
end
wait(0.1)
end
There isn't anything that I can think of that I added or removed that would cause that error. The whole hunter and demon selecting isn't finished yet so it doesn't work atm but it has stayed exactly the same since the script was running smoothly. I was trying to test the selecting to see if it worked but I got that error and it won't even run any of my scripts at all. It was working just fine before I don't think I did anything that would cause this but if anybody knows please help.
