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: Time Problem

Previous Thread :: Next Thread 
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
17 Sep 2013 09:54 PM
After an hour of narrowing down a script, I finally found what keeps causing my game to freeze upon testing:

for i=1,30 do
RTime.Value=30-i
wait(1)
end



Why does it freeze? What can I do to fix it?
Report Abuse
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
17 Sep 2013 09:56 PM
FYI, RTime is a defined variable, and is a NumberValue
Report Abuse
Geomaster is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
17 Sep 2013 09:57 PM
Try this instead:

for i = 30, 1, -1 do
RTime.Value = i
wait(1)
end


Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
17 Sep 2013 09:57 PM
Output?
Report Abuse
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
17 Sep 2013 09:59 PM
No output, as it freezes as soon as it opens a test server.
Report Abuse
Geomaster is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
17 Sep 2013 10:01 PM
I mean, process goes as is:

for i=1,30 do
RTime.Value=30-i
wait(1)
end

First iteration: i = 1, 30-i = 29, RTime = 29
Second: i = 2, 30-i = 28, RTime = 28..ect.
Eventually ending at 30-30 which is 0
Can numvalues be 0?
I think they can
Report Abuse
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
17 Sep 2013 10:01 PM
It still freezes, Geo.

Did For/While/Repeat loops break?

I just tried each and still nothing happens.
Report Abuse
Geomaster is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
17 Sep 2013 10:04 PM
So I just did this on my own


local num = workspace.Num

for i = 30, 1, -1 do
num.Value = i
wait(1)
print(num.Value)
end


No freezes, output was a countdown from 30

I have to assume from this that yours is breaking from exterior code
Report Abuse
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
17 Sep 2013 10:06 PM
Alright, good to know.

I'll see if I can't find something else that may be the cause of the freezes.
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
17 Sep 2013 10:07 PM
Usually when a server freezes, there is an uncontrolled while loop. As in

while true do
end

Or something like that. The problem isnt the while true do, or while 2+2 == 4, or while game.Workspace:findFirstChild("Potatos") do, or any of that

The problem is that there is no wait() and that there is an infinite loop. Are you sure that's the script thats causing all the scripts? Or is that script going to trigger another script...?
Report Abuse
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
17 Sep 2013 10:40 PM
Well, I fixed the problem somehow.

I think it is my PC. Lately its been acting slower than normal and video/picture quality is bad. But miraculously the freezes stopped.
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