generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Game script timeout

Previous Thread :: Next Thread 
ked2000 is not online. ked2000
Joined: 10 Jul 2011
Total Posts: 1059
27 Jul 2014 11:44 AM
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
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
27 Jul 2014 11:46 AM
its becuz ur code is horrible
Report Abuse
ked2000 is not online. ked2000
Joined: 10 Jul 2011
Total Posts: 1059
27 Jul 2014 11:49 AM
o rlly? lemme se ur code.
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
27 Jul 2014 11:55 AM
post ur code and i can help
Report Abuse
ked2000 is not online. ked2000
Joined: 10 Jul 2011
Total Posts: 1059
27 Jul 2014 11:55 AM
All of it or just run()?
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
27 Jul 2014 11:56 AM
just run
Report Abuse
ked2000 is not online. ked2000
Joined: 10 Jul 2011
Total Posts: 1059
27 Jul 2014 11:57 AM
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
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
27 Jul 2014 12:00 PM
You should take the loop out and do this instead

while wait() do
run()
end
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
27 Jul 2014 12:02 PM
*
Make sure to remove award and intermission from run()

while wait() do
run()
award(playing)
intermission()
end
Report Abuse
ked2000 is not online. ked2000
Joined: 10 Jul 2011
Total Posts: 1059
27 Jul 2014 12:03 PM
Didn't work.
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
27 Jul 2014 12:10 PM
Is this ever true?
if (sets[chosenSet]) then
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
27 Jul 2014 12:11 PM
Trying to figure out why the script isn't waiting
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
27 Jul 2014 12:11 PM
^Ignore that lol
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
27 Jul 2014 12:15 PM
You have an infinite loop somewhere
Report Abuse
ked2000 is not online. ked2000
Joined: 10 Jul 2011
Total Posts: 1059
27 Jul 2014 12:19 PM
sets[chosenSet] returns true because it exists.

The only loop that runs forever is in run()
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
27 Jul 2014 12:20 PM
When do you get the error?
Does the game at least start?
Report Abuse
ked2000 is not online. ked2000
Joined: 10 Jul 2011
Total Posts: 1059
27 Jul 2014 12:21 PM
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.
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
27 Jul 2014 12:24 PM
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 :(
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
27 Jul 2014 12:25 PM
Or before calling run
repeat wait(.1) until #game.Players:GetPlayers() > 0
Report Abuse
ked2000 is not online. ked2000
Joined: 10 Jul 2011
Total Posts: 1059
27 Jul 2014 12:29 PM
I tried your methods and I added a function to wait for players, I still get the error.
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
27 Jul 2014 12:32 PM
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
Report Abuse
ked2000 is not online. ked2000
Joined: 10 Jul 2011
Total Posts: 1059
27 Jul 2014 12:39 PM
Thanks!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image