How would I make a loop on the client without a `While true:` loop?

I would like to be able to have something called every frame, but without using a While true: loop as I’m used to Roblox’s game.RunService.PreRender(delta)

I remember hearing there is something similar to that, but I forgot what, if you could tell me that would be great!

1 Like

Check out TimeSystem class | TruWorlds Creator

local timer = 0
game.TimeSystem.FrameStepped.Connect(func(dt):
    # dt is the time that elapsed since the last frame in seconds
    timer = timer + dt
    print(timer)
)
1 Like