Plus I love DataStore2, a free tool gifted to the Roblox community by the Roblox community for even easier work with data stores as it caches data to ensure it isn't lost. The only problem in real games is how to decide when and what to load which can become very problematic if done wrong as memory leaks can occur (not cleaning up old data so new data is added over time and causes the server to degrade).
God bless your soul dude, i had so much problm saving stuff in my games, now i can do it peacefully instead of punching random words in my keyboard until it does something
thanks for keeping it simple and sticking to the point, every tutorial I watched was just people giving awful explanations, trying to explain pcalls and other code separate from datastore overloading my brain
DataStores gave me hell as a newer scripter, but I can handle them pretty well now - my preferred method is to loop through the player’s descendants, saving their stats as IntValues, NumValues etc., and identifying them by their name and parent if necessary. Nice tutorial by the way.
I should add, though, that you should probably add a game:BindToClose(function() along with a wait() and your saving function to act as a catch-all, since Roblox Studio doesn’t always detect when you press the stop button.
Thanks dude! You helped me overcome the hell of not understanding data stores. Can you also post a video explaining in more detail about data stores, such as what is pcall function and more?
Hey nice video, you helped a lot, suggestion: Could you make a video like this with datastores but instead it is where you buy something from a shop and the thing you bought saves in your inventory after you die and/or leave the game.
I'm trying to make an Incremental game on Roblox, this should help me a lot! I'm new to scripting, I thought of Parent to Child relationship between Instances too literally. I thought the Parent container couldn't be the Parent of the other Parent's children. Now I understand you can search anything if you reference the correct String Value.
Very good explanation, but I have 1 question. In this video you made a DataStore for coins, but I have more values to store, lets say for example Stamina, Strength or whatever it is, do I create a DataStore for each data ?
They should make it so you could erase everything on game's datastore. Also I have been suffering trying to make a datastore thing, it really depends what you're trying to code.
guys heres an advice from me: dont make datastores saving only on leaving! Make it save every time coins change instead, because if its only when you leave, if you can drop coins in your game then you can make a dupe glitch on private servers basically player1 drops 5 coins to player2, player2 leaves and the 5 coins save, but player1 SHUTS DOWN his private server so the data doesnt save, so he has 5 coins again
@@AxajonOFFICIALits so simple, if you have an inventory system or currency just make it save every time it gets changed, like make a new function that runs whenever the value changes and when it does it sets your async and updates.
@@darkarcher908 saving player data everytime a value changes sound like a performance nightmare in any game with fast changing values and a decent amount of players.
I use profile service, because get and setAsync stops working after 200 players in your game in total. Profile Service is just a lot more reliable and it's great for server shut downs.
personally i use profileservice and it works great, finally i managed to master even this lol, even though i guess ima abandon game development, somehow it doesnt fit me, and probably its just fact i always got no game ideas to make, and i work alone ):
Should we really use SetAsync for a system like that? Isn't it better to use UpdateAsync? I don't really understand what's the point of UpdateAsync compared to SetAsync
@@iamLudius Eh, it's really not that simple. Maybe if you are just using a simple cash system, and that is the only key you need to store. I would say the way you described it is DataStores at their simplest form. They can get much more complex.
@@imthebestmayne122 Ludius explained it in a simple way so that datastores are more approachable. Once you understand the fundamentals of datastores, that means the more "complicated" datastores aren't as complicated as they seem.
@@urnix69 gotta say I disagree with this. No disrespect either to you or the poster. Most of this information (and more) can just be read from the data store api page on the roblox documentation page. What is much harder is finding information about more complicated data stores. Look at somethibt like ProfileService or DataStores2. I guess this video helps understand it at a very rudimentary level, but nothing further than that.
ill pay 50 robux who will do working DataStore script (i have 3 values) i checked the 3 tutorials and all of these tutotials doesn't work (ChatGPT also didn't help me)
@@rakirat640 the video EXPLAINS it in an approcheable way. basically i had NO IDEA how datastore works, but after watching this video which showed examples of using numbers, i used my brain to think of the other ways i could use datastore based on the knowledge i had.
As much as I'd like to help you and any other person that may need me, at the moment my schedule's packed, sorry man :[ But maybe I can help you through the dev calls inside the discord server?
Bro wth every other video i saw on this was 30 mins and didn't work and this was 10 mins and it worked first try! Thank you so much!!! one problem that i have is that i dont know how to make multiple datas save Edit learned how to do it it was so easy! Just looked at a little bit of the documentations
is there something im missing? because ive been trying to get datastore working for a year now but nothing i do seems to work, i enabled studio to api, followed everything in the video but doesn't work
@@iamLudius How so? Would it be like: You declare a table like "playerData = {}" and then you would use table.insert(table, value) in the player connect function? Then call that table when the player leaves?
i always used to think learning data stores for me was going to be a nightmare, this man proved me wrong in 15 lines of code
Lol fr
Plus I love DataStore2, a free tool gifted to the Roblox community by the Roblox community for even easier work with data stores as it caches data to ensure it isn't lost. The only problem in real games is how to decide when and what to load which can become very problematic if done wrong as memory leaks can occur (not cleaning up old data so new data is added over time and causes the server to degrade).
I watched videos for hours and didn't understand it but your 10 minute video was so simple and wall explained, thanks alot.
God bless your soul dude, i had so much problm saving stuff in my games, now i can do it peacefully instead of punching random words in my keyboard until it does something
Honestly i don't understand why people think data store as something nightmarish. On the start it was annoying. Now it's nothing.
It actually gets so simple later on
whats the hardest thing in roblox scripting to grasp?
@@iamLudiuscan you help me with datastore?
@@nallejansson4329probably mastering cframes since it requires deep mathimatical knowledge
@@nallejansson4329probably oop once you grasp that you can pretty much do anything
thank you so so much dude. thsi is a underrated video. i didnt understand this but you explained it so well!!
thanks for keeping it simple and sticking to the point, every tutorial I watched was just people giving awful explanations, trying to explain pcalls and other code separate from datastore overloading my brain
DataStores gave me hell as a newer scripter, but I can handle them pretty well now - my preferred method is to loop through the player’s descendants, saving their stats as IntValues, NumValues etc., and identifying them by their name and parent if necessary. Nice tutorial by the way.
I should add, though, that you should probably add a game:BindToClose(function() along with a wait() and your saving function to act as a catch-all, since Roblox Studio doesn’t always detect when you press the stop button.
finally someone who EXPLAINS datastoring and not makes me copy their script
thank you i've recently been struggling on data store and now after a lot of practice, i can make it from scratch!
That's great man! Keep up the good work and best of luck with your dev journey :]
w, i want to achieve that level
Thanks man, I didn't get the logical behind datasave, but now it works
Thanks dude! You helped me overcome the hell of not understanding data stores. Can you also post a video explaining in more detail about data stores, such as what is pcall function and more?
I only have one thing to say:
Thank you so much for explaining this, now I understand datastores.
Hey nice video, you helped a lot, suggestion: Could you make a video like this with datastores but instead it is where you buy something from a shop and the thing you bought saves in your inventory after you die and/or leave the game.
i like ur editing style great video i learned something from it
Thank you so much bro i was so confused abt data store and now it feels so simple
thank you sir. Talking in a manner which noobs like me can understand
Really useful vid, I thought it was hard but it was actually easy, thx.
bro I can say this is the best tutorial ever ive seen from 25 videos, u explain it + u explain very good. tysm bro
finally someone who explains the damn code
I'm trying to make an Incremental game on Roblox, this should help me a lot!
I'm new to scripting, I thought of Parent to Child relationship between Instances too literally.
I thought the Parent container couldn't be the Parent of the other Parent's children.
Now I understand you can search anything if you reference the correct String Value.
Its amazing i can see my scripting has improved because 1 month ago i couldnt even undertsand anything of this and now i understand it
this dude literally makes the best roblox guides on yt
Aye thanks for the encouraging words bro, it really means a lot :]
Also thanks for the comment
You just gained one sub! Best video I watched about datastore!
THANK YOU! ONLY YOUR DATA STORE WORKING!!!
Wow, that's really easy. Thank you so much for the video!
datastore viewer plugin goes hard
is it free
Nope
you can just learn datastore without needing any plugin
@@billybobjankens12 i did that
THANK YOU LUDIUS!! I LOVE YOU!! 😭
Love you. Now i understand it. ❤
The only time its gonna be hell is when you have a lot of things to store
this guy is extremely underrated
bestt explanation
I'm happy to hear that :]
GetAsync is to check if the player is in the list and SetAsync is to set the players data
Very good explanation, but I have 1 question. In this video you made a DataStore for coins, but I have more values to store, lets say for example Stamina, Strength or whatever it is, do I create a DataStore for each data ?
They should make it so you could erase everything on game's datastore.
Also I have been suffering trying to make a datastore thing, it really depends what you're trying to code.
woah, thank you so much.
your games broken nothings getting saved
guys heres an advice from me:
dont make datastores saving only on leaving! Make it save every time coins change instead, because if its only when you leave, if you can drop coins in your game then you can make a dupe glitch on private servers
basically player1 drops 5 coins to player2, player2 leaves and the 5 coins save, but player1 SHUTS DOWN his private server so the data doesnt save, so he has 5 coins again
bro can you please tell how we can do that properly?
@@AxajonOFFICIALits so simple, if you have an inventory system or currency just make it save every time it gets changed, like make a new function that runs whenever the value changes and when it does it sets your async and updates.
@@darkarcher908 saving player data everytime a value changes sound like a performance nightmare in any game with fast changing values and a decent amount of players.
I use profile service, because get and setAsync stops working after 200 players in your game in total. Profile Service is just a lot more reliable and it's great for server shut downs.
I had never heard about this, but thanks for the heads up, I'll look into it :]
200players in a server
@@Chlrintruc Yeah, just read that. But It is still really inefficient to use when there are these adanced things out there (even bloxfruits uses it)
@@PiecePoster ok then I'll try to learn it.
@@PiecePosterdoes BloxFruit use Profile Service?
personally i use profileservice and it works great, finally i managed to master even this lol, even though i guess ima abandon game development, somehow it doesnt fit me, and probably its just fact i always got no game ideas to make, and i work alone ):
I've never really heard about Profile Service, but I'll take a look into it when I get the chance
well, idk why but it always says: DataStore can't be accessed from client why???
Should we really use SetAsync for a system like that? Isn't it better to use UpdateAsync? I don't really understand what's the point of UpdateAsync compared to SetAsync
imagine how would it look like in c++
the start is sooo real
"Datastore: A Sripter's Worst Nightmares Explained"
Meanwhile:
:GetAsync() and :SetAsync()
Literally, it's that simple, people tend to overthink it jajajaja
@@iamLudius Eh, it's really not that simple. Maybe if you are just using a simple cash system, and that is the only key you need to store. I would say the way you described it is DataStores at their simplest form. They can get much more complex.
@@imthebestmayne122 Ludius explained it in a simple way so that datastores are more approachable. Once you understand the fundamentals of datastores, that means the more "complicated" datastores aren't as complicated as they seem.
Just create a good module script
It works as well
@@urnix69 gotta say I disagree with this. No disrespect either to you or the poster. Most of this information (and more) can just be read from the data store api page on the roblox documentation page. What is much harder is finding information about more complicated data stores. Look at somethibt like ProfileService or DataStores2. I guess this video helps understand it at a very rudimentary level, but nothing further than that.
i have a script where every second the leaderstats value goes up i did the datastore part now it freezes at 0
a good day when ludius drops
Damn, this really means a lot to me, I'm glad you enjoy my content. And also thanks for the comment :]
@@iamLudius hell yeah I even bought that scripting book cause of you to get better for my game as well
Tho the script u described wasn’t a really good script because if there’s an error the player won’t get the data at all which is bad
I like your detailed explanation an i tried it in my obby game but it is not working can you please make a video on it? please
ill pay 50 robux who will do working DataStore script (i have 3 values)
i checked the 3 tutorials and all of these tutotials doesn't work
(ChatGPT also didn't help me)
but it says how to make it in the video!!
@@CyanNStuff it didnt work
@@rakirat640 did you put the script in serverscriptservice?
I’ll do it
@@rakirat640 the video EXPLAINS it in an approcheable way.
basically i had NO IDEA how datastore works, but after watching this video which showed examples of using numbers, i used my brain to think of the other ways i could use datastore based on the knowledge i had.
tbh for me data store wasn't and isn't my worst nightmare cause 1st place for worst nightmare takes math and object oriented programming
Datastores is just a pain and very repetitve to do because of failsaving and the log way to get data and trying to get every single data.. Who agrees?
Love your videos Ludius! I am looking for a scripter for a game I am working on. Would you be interested?
As much as I'd like to help you and any other person that may need me, at the moment my schedule's packed, sorry man :[
But maybe I can help you through the dev calls inside the discord server?
Everyone gangsta til roblox datastores go down
is it work with modules engines?
Agreed
Bro wth every other video i saw on this was 30 mins and didn't work and this was 10 mins and it worked first try! Thank you so much!!! one problem that i have is that i dont know how to make multiple datas save
Edit learned how to do it it was so easy! Just looked at a little bit of the documentations
i got everything to work now i just dont know how to give myself money in my own game
but how do you save multiple values? that's where i get confused cause i have over 100 values
maybe try putting your values in a table and saving the table?
So much wrong with this video. You don't prepare in the event that a read/write fails. DataStores are scary because of the amount of edge cases.
is there something im missing? because ive been trying to get datastore working for a year now but nothing i do seems to work, i enabled studio to api, followed everything in the video but doesn't work
a year is mad, you need to do your own research and get more specific with how luau works if its been that long
@@roboket3524 its not exactly a year its just been on and off for the most part but ive been trying for a week and still can't figure it out
i tried using this datastore script with a boolvalue, but it didn't work
Real
Let's say there is two data. Coins and Levels. How can you save both?
im pretty sure there is a more efficient way to do so then what im saying but just make 2 seperate datastores.
U can do that or just save put them both in a table and just save it to one single player data datastore
Put them both in a table before saving
@@iamLudius How so? Would it be like: You declare a table like "playerData = {}" and then you would use table.insert(table, value) in the player connect function? Then call that table when the player leaves?
how can i make gui button that adds value to player datastore?
Dude, you should talk about pcalls when talking about datastores, otherwise your viewers will have problems in their games
real
I still dont get it😭
then rewatch it until you do thats the only way of learning 🤷♂️
@@Jxhsxn Nah, I stole a script instead🤑
alll i hear the word is "right"
stopped watching at "wait(1)"
is datastore support JSON?
No idea what JSON means, sounds familiar tho
Yes if you put the json data in a table first by using HttpsService:JSONDecode() you can save it
@@iamLudius Javascript Object Notation is a storage in website which converts all the tables into string!
it's like a datastore you can save your data just like JSON
w vid
rookie
i still dont get it, way too complicated, and half of your code i had to ask AI to help me fix it, and at the end it still doesnt work for me
This is way too easy 💀
type stuff
That's wassup
you should speak slower, i needed to put the video on speed 0.75
i love datastores and hate anim and shi lol
dude you talk so fast i dont understand nothing but good try
SECOND
That's wassup!
FIRST
That's what I'm talking about!
@@iamLudius yessir
kjk
You always boosting your algorithm with your comments jajaajaja
I appreciate it :]
kjk@@iamLudius