Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would you wait for less than .03 seconds?

From what I see on roblox wiki, wait() can only go as fast as .03 seconds. I need to go faster than that. Is there anyway is can go faster, or what is the fastest I can go if I am wrong?

Heres the part of my script that needs the faster wait.

while true do
	wait(.03) --Needs to be .001
	for i, folder in pairs(clockFolder:GetChildren()) do
		local clock = folder.Clock
		local getLength = lengthFolder[folder.Name]:GetPlayingAnimationTracks()
		for i, track in pairs (getLength) do
		if clock.Value >= track.Length then
			clock.Value = 0
		else
			clock.Value = clock.Value + .03 -- Also needs to be .001
		end
		end
	end
end

1 comment

3 answers

It can go to 0.03 only. There could be other ways ( I suggest looking through the web), but I could lag your game, a lot.

2 comments

0

Shawnyg's comment was better.

1

technically not a wrong answer, but you should specify which way(s)

you could use RunServices Heartbeat or Renderstepped, i think those are fastest but lag a lot

No I don't think the limit is 0.03s(Not sure, I read it somewhere that the limit is 0,03s too), but according to https://devforum.roblox.com/t/how-to-use-wait-for-less-than-0-1-seconds/413781(Link blocked, you may want to copy and paste). I've seen game that waits up to 0.0000001 and more and this is crazy because this can cause much lag to the game which I don't recommend.

while true do
    wait(.001) -- Nope, the limit is not .03
    for i, folder in pairs(clockFolder:GetChildren()) do
        local clock = folder.Clock
        local getLength = lengthFolder[folder.Name]:GetPlayingAnimationTracks()
        for i, track in pairs (getLength) do
        if clock.Value >= track.Length then
            clock.Value = 0
        else
            clock.Value = clock.Value + .001
        end
        end
    end
end

5 comments

0

That is not it chief

0

what are you rambling about, if you go below 0.03 it sets automatically to 0.03

0

im just saying according to the forum

0

@mkhamster What are u talking about? Im not the only one who said that i seen game that waits up to 0.0000001s, even roblox themselves say, and theirs wait even longer. https://blog.roblox.com/2012/05/using-wait-wisely/

0

maybe check the date?

This discussion is preserved as it was. New answers, comments, and votes are closed.