How Would I slow down this function which retries itself it it doesn’t get the Correct Number?
It can fire really fast and cause lag, How would I do this?
Example:
NumberExample = function(x: number)
local Number = math.random(1,100)
if Number == x then
print("Finished")
else
NumberExample(95)
end
end)
NumberExample(95)
NumberExample = function(x: number)
local Number = math.random(1,100)
if Number == x then
print("Finished")
else
if i % 512 == 1 then task.wait() end
i += 1
NumberExample(x)
end
end)
Ah, i am an idiot, all i needed to add was a simple wait
NumberExample = function(x: number)
local Number = math.random(1, 100); print(Number)
if Number == x then
print("Finished")
else
task.wait(.1)
NumberExample(x)
end
end
NumberExample(95)