If you are curious whether you can freeze the client for a specific time(seconds), here’s the code.
I tried to make something like a delayer that is not dependent on the Task Scheduler and is more precise than task.wait(). Well, it didn’t work by the way as intended, because if the client is frozen it is not counted as a delay.
How is it working?
It overloads the CPU and measures the time that passed if it reaches the mark, it will release
Lua
local function DelayFor(time)
local current_time = os.clock()
while os.clock() - current_time < time do end
end
DelayFor(.01)
TS
function DelayFor(time: number) {
const current_time = os.clock();
while (os.clock() - current_time < time) { }
}
DelayFor(.01);
If you have ever used it, or just have an idea where to use it reply to this post.
Very curious if someone will find the usage of that