I'm currently having issues while developing a script for one of my game's DataStores. I want the DataStore to save values (NumberValues, IntValues, etc.) but I've read on the Wiki:
Unlike Data Persistance, Data Stores cannot save ROBLOX instances directly. For example, calling DataStore:SetAsync("key", Instance.new("Part")) will throw an error. You should write a function that converts the instance to a table or string.
How would I go about converting an instance like a NumberValue or other value to a table or string? Would I need to use tostring()?

2 comments
Well, you can save the value of the numbervalue, and when you load the datastore just change the value to what you have saved
No, you would not need to use tostring, as that will put a nil value