What if you were to do wait(1/60)?

If you were to do, say, four things, would it combine into two sets of two and do the sets at the exact same time, or would it actually split into 1/60th of a second?

Im not quite sure but i think it should make you wait for less than 0.1 sec which is probably (1/10)

I prefer the decimal than dividing

I believe wait runs at 30fps, so it’ll just clamp to 1/30th second.

3 Likes

Yeah, you would do any combination. Whatever the number comes out to is how long the wait will be. Some are listed below. If it was 1/60 you would be waiting ~ 0.15 seconds.

wait(math.huge)
wait(60/1)
wait(6/6)
wait(2^3)
wait()

Example with Variables:

local v1 = 6
local v4 = 2

print( "This is how long the wait time is: " .. tostring( v1^ v4) )

wait(v1 ^ v4)
1 Like

Minimum wait time is about 1/30.
wait(.00000000000000001) as people sometimes try to do is effectively the same as wait(.0333), but if you really want to wait for the smallest amount of time, use wait() with no parentheses.

2 Likes

Each Roblox frame is 1/30th of a second, so yes, that would be pretty obvious. Also, you need to do division for frames in the 1/3 area, and also also, Why do decimals when it comes to time less than a single second? That seems so unnecessary, and what if you got the math wrong or something?

wait() with no argument was what I typically do, but is there any workarounds for ones with lower than 1/30? It is kind of important that I need to do it lower than 1/30th

Edit: Can I use something like say heartbeat or something? and subtract from a timer if it can shoot and don’t shoot if it can’t or something like that?

Roblox has a limit if 1/30 frames.

1 Like

You can use events in a lot of different ways. The events that go 1/60 you can do this

RunService.RenderStepped:Wait()

You can also do busy waiting if you are careful

local start = tick()
repeat until tick()-start >= .001

but it will bog down the script until .001 seconds have passed. It can be fine for really small numbers, but imagine a 5 second freeze if you wanted to wait for 5 seconds. Give it a go if you are curious.

Also, this used to be a creative workaround before RunService existed, don’t know if it still works and I certainly don’t recommend it.

while true do
   coroutine.yield() -- ~1/60
end
2 Likes

Alright, thanks. Roblox really needs to allow a 1/60 option for specific games for those who need super fast frames per second, because although 1/30 literally cuts the computing in half, and in almost every cases, are fine, there needs to be a thing for things like, say FPS, or rhythm games, where maybe developers can pay like an amount of Robux or something for their games, which can solve the whole cost problems posed by increased framerate, and possibly generate extra revenue.

Paying to develop defeats the whole purpose. There are always alternatives, but the long and the short of it is that all of the events and triggers Roblox uses are based on FPS in some way or another. I’m not sure how Phantom Forces handles their projectile timing, but you can try asking AxisAngle. He’s always been in a good mood to help when I’ve messaged him, so long as he doesn’t think it would be prudent to keep it a secret.