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 » Scripters
Home Search
 

Re: Really weird LocalScript Error

Previous Thread :: Next Thread 
DemonicRegalia is not online. DemonicRegalia
Joined: 25 Jun 2010
Total Posts: 3383
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
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
27 May 2015 01:35 AM
Well. Except if the complete game has a fps lower than 10 it shouldn't matter.
Report Abuse
DemonicRegalia is not online. DemonicRegalia
Joined: 25 Jun 2010
Total Posts: 3383
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 is not online. udayk8139
Joined: 25 Aug 2013
Total Posts: 622
27 May 2015 02:44 AM
o.O cAlL MAstre scripterz11
Report Abuse
DemonicRegalia is not online. DemonicRegalia
Joined: 25 Jun 2010
Total Posts: 3383
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 is not online. 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 is not online. 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
DemonicRegalia is not online. DemonicRegalia
Joined: 25 Jun 2010
Total Posts: 3383
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
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
27 May 2015 02:15 PM
Nah. you're just using weird code. use wait() instead of wait(.1)
Report Abuse
DemonicRegalia is not online. DemonicRegalia
Joined: 25 Jun 2010
Total Posts: 3383
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
DemonicRegalia is not online. DemonicRegalia
Joined: 25 Jun 2010
Total Posts: 3383
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
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
27 May 2015 02:31 PM
Do you have "Anti lag" scripts in those places or something?
Report Abuse
TimeTicks is not online. 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
DeveloperBlue is not online. DeveloperBlue
Joined: 15 Apr 2009
Total Posts: 1344
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
DemonicRegalia is not online. DemonicRegalia
Joined: 25 Jun 2010
Total Posts: 3383
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
DemonicRegalia is not online. DemonicRegalia
Joined: 25 Jun 2010
Total Posts: 3383
27 May 2015 03:48 PM
Update: The lag seems to be gone. Wait() functions are finally performing normally. Thanks everyone
Report Abuse
DeveloperBlue is not online. DeveloperBlue
Joined: 15 Apr 2009
Total Posts: 1344
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
DemonicRegalia is not online. DemonicRegalia
Joined: 25 Jun 2010
Total Posts: 3383
27 May 2015 06:32 PM
no I'm just an idiot
Report Abuse
DeveloperBlue is not online. DeveloperBlue
Joined: 15 Apr 2009
Total Posts: 1344
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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