I was thinking about going about a while true do loop and autosaving
while wait(30) do DataStore:SetAsync(plr.UserId,Val) end
Some might say im overdoing it it but the max interval is 6 seconds really I could be saving 15 seconds
It depends. You could have a game where the player's data changes frequently where you need to save the data often, but you could also have a game where the data doesnt change as much.
If the data failed to save when the player leaves and you had to rely on autosave, ask yourself: is the data that was saved two minutes ago alright? did the player lose a lot of data to the point where they'd be mad? if the answer is yes, then update more frequently. if not, you can get away with saving every 2-5 minutes.
If you save data too frequently, you might run into the issue of having too many requests to save data which causes your save requests to be added to a queue.
I recommend using looped ds: UpdateAsync () and ds: SetAsync () when the player leaves the room.