of     1   

ked2000
#141737086Sunday, July 27, 2014 4:44 PM GMT

I have a function definition called run() at line 174. It continues running in a endless loop. I do not know what this error means, I have never had it before. I do not want to post a whole block of code if it won't help. I looked this error up but I did not find anything. Can someone tell me what's causing this(I will post the code if need be)? Error: Workspace.Main: 174: Game script timeout
BothAngles
#141737284Sunday, July 27, 2014 4:46 PM GMT

its becuz ur code is horrible
ked2000
#141737491Sunday, July 27, 2014 4:49 PM GMT

o rlly? lemme se ur code.
BothAngles
#141737901Sunday, July 27, 2014 4:55 PM GMT

post ur code and i can help
ked2000
#141737960Sunday, July 27, 2014 4:55 PM GMT

All of it or just run()?
BothAngles
#141738002Sunday, July 27, 2014 4:56 PM GMT

just run
ked2000
#141738120Sunday, July 27, 2014 4:57 PM GMT

function run() while true do local currentSet = {}; if (sets[chosenSet]) then for _, player in pairs(game:GetService("Players"):GetPlayers()) do print("Starting next game") local gui = player:FindFirstChild("PlayerGui").TextGui gui.Frame1.TextBox.Text = "Welcome to True or false!" wait(4) for i = 5, 0, -1 do gui.Frame1.TextBox.Text = "Beginning in "..i.." seconds." end chooseSet() gui.Frame1.TextBox.Text = chosenSet.." set selected!" local index; index, currentSet = chooseQuestions(currentSet) print("Got "..#currentSet.." questions in current set "..chosenSet) teleportPlayer(player, -9.3, 54.99, -461.5) for i, v in pairs(out) do if (v:lower() == player.Name:lower()) then table.remove(out, i)end end table.insert(playing, player.Name) wait(3) gui.Frame1.TextBox.Text = "There are "..#currentSet.." questions in the "..chosenSet.." set!" wait(3) gui.Frame1.TextBox.Text = sets[chosenSet].Reward.." Bronze Coins will be awarded to the winners per round." wait(3) for i = 1, index do gui.Frame1.TextBox.Text = "Question "..i.."!" wait(3) ask(currentSet[i]) end print("Finishing game.") gui.Frame1.TextBox.Text = "Game Over!" wait(3) gui.Frame1.TextBox.Text = "The winner(s) are : "..table.concat(playing, ", ").."! Congratulations!" wait(3) gui.Frame1.TextBox.Text = "The winner(s) are being awarded "..sets[chosenSet].Reward.." Bronze Coins." award(playing) intermission() end end end end
BothAngles
#141738370Sunday, July 27, 2014 5:00 PM GMT

You should take the loop out and do this instead while wait() do run() end
BothAngles
#141738507Sunday, July 27, 2014 5:02 PM GMT

* Make sure to remove award and intermission from run() while wait() do run() award(playing) intermission() end
ked2000
#141738610Sunday, July 27, 2014 5:03 PM GMT

Didn't work.
BothAngles
#141739290Sunday, July 27, 2014 5:10 PM GMT

Is this ever true? if (sets[chosenSet]) then
BothAngles
#141739395Sunday, July 27, 2014 5:11 PM GMT

Trying to figure out why the script isn't waiting
BothAngles
#141739445Sunday, July 27, 2014 5:11 PM GMT

^Ignore that lol
BothAngles
#141739814Sunday, July 27, 2014 5:15 PM GMT

You have an infinite loop somewhere
ked2000
#141740094Sunday, July 27, 2014 5:19 PM GMT

sets[chosenSet] returns true because it exists. The only loop that runs forever is in run()
BothAngles
#141740262Sunday, July 27, 2014 5:20 PM GMT

When do you get the error? Does the game at least start?
ked2000
#141740423Sunday, July 27, 2014 5:21 PM GMT

I get the error once the server loads(AKA. When I join the game). The game doesn't start because it errors where I call it.
BothAngles
#141740683Sunday, July 27, 2014 5:24 PM GMT

That happens because there aren't any players when the server starts and all the waits are located in the player loop That means my script works but you didn't use it :(
BothAngles
#141740825Sunday, July 27, 2014 5:25 PM GMT

Or before calling run repeat wait(.1) until #game.Players:GetPlayers() > 0
ked2000
#141741203Sunday, July 27, 2014 5:29 PM GMT

I tried your methods and I added a function to wait for players, I still get the error.
BothAngles
#141741488Sunday, July 27, 2014 5:32 PM GMT

function run() local currentSet = {}; if (sets[chosenSet]) then for _, player in pairs(game:GetService("Players"):GetPlayers()) do print("Starting next game") local gui = player:FindFirstChild("PlayerGui").TextGui gui.Frame1.TextBox.Text = "Welcome to True or false!" wait(4) for i = 5, 0, -1 do gui.Frame1.TextBox.Text = "Beginning in "..i.." seconds." end chooseSet() gui.Frame1.TextBox.Text = chosenSet.." set selected!" local index; index, currentSet = chooseQuestions(currentSet) print("Got "..#currentSet.." questions in current set "..chosenSet) teleportPlayer(player, -9.3, 54.99, -461.5) for i, v in pairs(out) do if (v:lower() == player.Name:lower()) then table.remove(out, i)end end table.insert(playing, player.Name) wait(3) gui.Frame1.TextBox.Text = "There are "..#currentSet.." questions in the "..chosenSet.." set!" wait(3) gui.Frame1.TextBox.Text = sets[chosenSet].Reward.." Bronze Coins will be awarded to the winners per round." wait(3) for i = 1, index do gui.Frame1.TextBox.Text = "Question "..i.."!" wait(3) ask(currentSet[i]) end print("Finishing game.") gui.Frame1.TextBox.Text = "Game Over!" wait(3) gui.Frame1.TextBox.Text = "The winner(s) are : "..table.concat(playing, ", ").."! Congratulations!" wait(3) gui.Frame1.TextBox.Text = "The winner(s) are being awarded "..sets[chosenSet].Reward.." Bronze Coins." award(playing) intermission() end end end while wait() do repeat wait(.1) until #game.Players:GetPlayers() > 0 run() end
ked2000
#141742209Sunday, July 27, 2014 5:39 PM GMT

Thanks!

    of     1