Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Which is the best way to go about making a secondary loop?

Asked by
wazap 100
10 years ago

Secondary loop as in a loop that runs along the main script

Option 1

coroutine.resume(coroutine.create(function() while true do wait(1) print(tick()) end end))

Option 2

Spawn(function() while true do wait(1) print(tick() end end)

Option 3

delay(0, function() while true do wait(1) print(tick()) end end)

Soo which is the most efficient?

1 answer

Log in to vote
0
Answered by 10 years ago

As long as it works, I don't think it matters. For instance,

print('Hello World')

or

print("Hello World")

ex 2)

while true do
wait()
end
--or
while wait(.644444444444) do
end

If the method interferes with the main script, why use it? It's logic.

What i'm trying to say...

They're ALL efficient if they all work.

0
Ummm. No. That's like saying that there's no need to use quicksort because bubble sort works. Destrings 406 — 10y
Ad

Answer this question