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: wait()

Previous Thread :: Next Thread 
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
10 May 2015 07:46 AM
any way to wait() less than .03 Seconds? except .Stepped...
cos I'm trying to rotate my Custom Joint at about 100 Frames (as I like to call it) per Rotational requirement... and so that makes it slow, but if I don't add any wait()s it will crash/lag :/
http://gyazo.com/6f98cfff434dc7c5de0495e9dcbb9bd0

"My Life is going Good... but..."
Report Abuse
Saldor010 is not online. Saldor010
Joined: 20 Sep 2010
Total Posts: 1035
10 May 2015 07:55 AM
I'm pretty sure it's impossible to wait any shorter than .05 seconds unless you want to try doing funky coroutine stuff.
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
10 May 2015 08:02 AM
funky couritine? hmmm
and, .03 is smaller than .05 so .05 is not the lowest...

l = tick() wait(.001) print(tick() - l) --I did .001 to test if .03 is rlly the minimum
>0.030923366546631

"My Life is going Good... but..."
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
10 May 2015 08:03 AM
game["Run Service"].RenderStepped:connect(function()
-- Runs every frame.
end)
Report Abuse
Saldor010 is not online. Saldor010
Joined: 20 Sep 2010
Total Posts: 1035
10 May 2015 08:03 AM
Weird, for some reason I always thought 0.05 was the lowest. Maybe I read it somewhere. Oh well, I doubt you'll get lower than 0.03, but you can try.
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
10 May 2015 08:05 AM
epic, that's what I tried in the Joint Demo I just showed...
so it's like
for i = 1, 100 do
.Stepped:wait()
--Rotate
end

"My Life is going Good... but..."
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
10 May 2015 08:09 AM
print(wait())
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
10 May 2015 08:11 AM
>0.037588919978589 138605.84723939

"My Life is going Good... but..."
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
10 May 2015 08:13 AM
People used to say that wait(0) would do but I've never tested it or used it
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
10 May 2015 08:14 AM
print(wait(0))
>0.030031839996809 138805.44117299

"My Life is going Good... but..."
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
10 May 2015 08:15 AM
dafuq lol
l = tick() wait(.0) print(tick() - l)
>0.044939279556274

"My Life is going Good... but..."
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
10 May 2015 09:11 AM
Make your own?

local wait = function(sec)
local now = tick()
while (now < (now + sec)) do
end
return tick() - now
end
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
10 May 2015 09:17 AM
@Abstract bad idea
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
10 May 2015 09:17 AM
Tested I hope? XD
Thnx
I forgot about something similar that eLun gave me for a wait()

"My Life is going Good... but..."
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
10 May 2015 09:17 AM
i just crashed meself
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
10 May 2015 09:20 AM
lol XD
I forgot that empty loops always crash XD

"My Life is going Good... but..."
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
10 May 2015 09:29 AM
Jeez I have no keyboard this'll be fun.

local function wait(s)
local start = tick();
local later = start+s;
while tick() < later do math.pow(4,5) end -- idk gotta do something
return tick()-start;
end

Btw busy waiting is bad it's better to run a scheduler in that loop instead
Report Abuse
gentledeadkiller is not online. gentledeadkiller
Joined: 09 Jul 2010
Total Posts: 10151
10 May 2015 09:38 AM
MY FIRST POST IN THE SCRIPTERS SUBFORUM
WOOOOOOOOOOOOOOOOOO

Verfluchen oder auch loben, Grad wie es ihnen gefällt.
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
10 May 2015 09:41 AM
thnx eLun, and em... Scheduler? am confused XD sry if this makes u type more and more, and u dont like typing mainly cos ur not on PC) XD

"My Life is going Good... but..."
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
10 May 2015 09:43 AM
I'm on PC but I'm using the on-screen keyboard

Your scheduler is a queue of functions to do instead of busy waiting, which is why I recommend Spawn over coroutines for most cases
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
10 May 2015 09:44 AM
function wait(t)
local start = tick()
while tick() - start < t do
coroutine.yield()
end
end

only works in non-coroutines
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
10 May 2015 09:54 AM
thnx guys :D

"My Life is going Good... but..."
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