I decided I’d try to learn and looked up some stuff on it. I wasn’t able to find any code samples so I just made my own script to update a value. I hope this is how it works, and if it isn’t can you guys help me?
I also have a few questions meanwhile UpdateAsync is used to update old data into new data. But how exactly do I update the new data? If I just return the new data wouldn’t that be the same thing as using SetAsync?
You return the new data unless something is off about the old data. It’s up to you on how to handle it, but you can read the old data to see if something is missing and then add it to the new data, or modify the new data based on the old data. :SetAsync() isn’t bad practice — like many say it is — it’s a valid option if it fits your needs, but if you’re making a DataStore I recommend the community-made ProfileService
I really appreciate your support and thank you for addressing that I can return the new data for updateAsync. I also appreciate community made services, but at the same time I don’t like using other people’s work for scripting on Roblox.
I will check out the service though, and see how they do some stuff. Thank you so much for your help man nobody was there and you were. I appreciate it so much.
I also don’t like using other people’s work lol! But ProfileService has always been an exception for me because of how easy it makes storing data… not to mention all the headaches with what could go wrong. They even include session-locking!
Imo the headaches are important to help you grow as a programmer. That’s why I don’t like using other people’s work because the more I experience the more I can overcome.
That was my mindset but I couldn’t keep it lol. I eventually said screw it and it helped me be able to focus on making the games I wanted instead of reinventing the wheel 1,000,000,000 times