|
| 27 May 2015 01:30 AM |
So in a LocalScript Hopperbin, whenever I do wait(.1) or any amount, it waits 10-20x that long and glitches pretty badly.
Also animations and reaching keyframes are a little glitchy.
Would a very slow computer cause the wait(.1) to be delayed a lot? |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 01:35 AM |
| Well. Except if the complete game has a fps lower than 10 it shouldn't matter. |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 02:40 AM |
Running this script in workspace in Play Solo:
active = true coroutine.resume(coroutine.create(function() wait(5) active = false end)) i = 0 while true do if active == false then break end i = i + 1 wait(.01) end print(i)
It outputs 146. What is wrong with my computer? |
|
|
| Report Abuse |
|
|
udayk8139
|
  |
| Joined: 25 Aug 2013 |
| Total Posts: 622 |
|
|
| 27 May 2015 02:44 AM |
| o.O cAlL MAstre scripterz11 |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 02:47 AM |
So you all know, the above script and the one I'm about to post were run in play solo in a script in workspace:
average = 0 total = 0 times = 60 for i = 1, times do local active = true coroutine.resume(coroutine.create(function() wait(1) active = false end)) i = 0 while true do if active == false then break end i = i + 1 wait(.01) end total = total + i end average = total / times print(average)
Yielded 26.33333 |
|
|
| Report Abuse |
|
|
Ghorre
|
  |
| Joined: 15 Feb 2015 |
| Total Posts: 160 |
|
|
| 27 May 2015 03:14 AM |
You're counting how many times the loop had run. That doesn't have to be exactly the time amount that You've waited... |
|
|
| Report Abuse |
|
|
larr1212
|
  |
| Joined: 06 Jan 2015 |
| Total Posts: 259 |
|
|
| 27 May 2015 03:23 AM |
@Ghorre
Actually that is a hacky way to get the FPS.
It is almost exact. |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 02:12 PM |
| So is this because my computer is laggy and I need a new one or what? I have a new alienware with maxed specs coming in on June 3rd so after that lag shouldn't be an issue, but could it be anything else? |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 02:15 PM |
| Nah. you're just using weird code. use wait() instead of wait(.1) |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 02:27 PM |
| It's not just that though, I have things running and the wait(whatevertime) takes literally 10-20x longer to fire, so everything gets screwed up. It only happens on one place though. |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 02:28 PM |
| This alt's account has an FPS Gui/lag tester in the game, and that isn't an issue for me. The thing is that one of my alt's places doesn't load in studio, and another has extremely slow wait() times. |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 02:31 PM |
| Do you have "Anti lag" scripts in those places or something? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 27 May 2015 02:59 PM |
| @Demonic, trash your computer and get a new one. |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 03:40 PM |
Can you please use tick() and tell us the numbers? I just dislike your method of counting for some reason.
Example:
local Start = tick() -- Run your function -- Function ends: print(tick() - Start)
- “My dear, here we must run as fast as we can, just to stay in place. And if you wish to go anywhere you must run twice as fast as that.” |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 03:47 PM |
@DevBlue
The script: Start = tick() average = 0 total = 0 times = 60 for i = 1, times do local active = true coroutine.resume(coroutine.create(function() wait(1) active = false end)) i = 0 while true do if active == false then break end i = i + 1 wait(.01) end total = total + i end average = total / times print(average) print(tick() - Start)
Output: 29.25 61.392538785934
|
|
|
| Report Abuse |
|
|
|
| 27 May 2015 03:48 PM |
| Update: The lag seems to be gone. Wait() functions are finally performing normally. Thanks everyone |
|
|
| Report Abuse |
|
|
|
| 27 May 2015 03:54 PM |
Awesome, but I also noticed you're using the 'i' variable twice. Is that on purpose?
for i = 1, times do
and
i = 0
- “My dear, here we must run as fast as we can, just to stay in place. And if you wish to go anywhere you must run twice as fast as that.” |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 Jun 2015 09:12 PM |
Woops, I see what you were doing. My bad, I have no clue what I was smoking that night.
- “My dear, here we must run as fast as we can, just to stay in place. And if you wish to go anywhere you must run twice as fast as that.” |
|
|
| Report Abuse |
|
|