Help making an autosave function.

Hey guys, I’m trying to write a hook that will autosave some things in my server. There is already a manual save function SaveSlots() and a hook that saves manually when you say a command. I was just wondering how to write a repeating timer that saves them automatically by calling the same function and then just printing something in the console like “slots saved” I’ve tried a few things but so far nothing has worked. Thanks!


timer.Create("hehe", 30, 0, function() doSaveFunction() print("slots saved") end)

Thanks for this!