was helping a friend debug his server today and i noticed he was doing this everywhere:
SetTimeout(60000, function()
-- do something every minute
SetTimeout(60000, function()
-- repeat
...
end)
end)
PLEASE just do:
CreateThread(function()
while true do
Wait(60000)
-- do something every minute
end
end)
cleaner, easier to read, no recursion. SetTimeout is for one-shot delayed actions, not recurring tasks.
basic but i see this constantly.