Advanced Roblox Scripting Tutorial #13 - Data Store / Saving Player Data (Beginner to Pro 2019)

Advanced Roblox Scripting Tutorial #13 - Data Store / Saving Player Data (Beginner to Pro 2019)
Hey guys, i know i've been gone for a while and i apologize for that but I am back and in today's video i am going to be teaching you guys about data stores and how they work. Basically saving player data. Anyways this a very long tutorial which is much needed. It goes into detail and specifics so anyone can understand it. Enjoy!
Articles Mentioned:
developer.roblox.com/en-us/ar...
developer.roblox.com/en-us/ar...
-- Follow me on twitter! (my name is tapwater because thats my main channel): / realtapwater
-- Follow me on Instagram! (my name is tapwater because of my main channel): / realtapwater
-Join my Discord Server to learn and meet other developers!-
/ discord
Link to Beginner's Tutorial Series:
• Beginner's Roblox Scri...
--What is this series about and who is it for?
So this series is meant for people who really want to learn exactly how to script, if that is you then I promise by the time you watch this whole series you will know exactly how to script on roblox. Anyways be sure to subscribe to see whenever I release a new tutorial and I will see you guys in the next one. Peace!

Пікірлер: 1 300

  • @garrettsmith1818
    @garrettsmith18183 жыл бұрын

    For anyone watching in the future: clicking the stop button in the home tab does not fire the PlayerRemoving event anymore. In order to test the script, go to the test tab and start a server. Close out on the player's tab and then you should see the data saved message in the output.

  • @ItzZanty

    @ItzZanty

    3 жыл бұрын

    you saved me a lot of time... thank you

  • @77kgmz66

    @77kgmz66

    3 жыл бұрын

    thanks bro

  • @skylarcanode-rhodes9771

    @skylarcanode-rhodes9771

    3 жыл бұрын

    Thanks!

  • @danielcawley1051

    @danielcawley1051

    3 жыл бұрын

    Thanks so much!

  • @ThanoSalt

    @ThanoSalt

    3 жыл бұрын

    Thnx

  • @4stray
    @4stray3 жыл бұрын

    I love how he doesnt just say, "Copy the script" He explains it so it does not just help us in datastores it helps us understand other scripts and what types of functions we need. It also helps us understand what were typing.

  • @snoanashi1597

    @snoanashi1597

    3 жыл бұрын

    "Copy the script and go away" - Probably me when I learn everything in Lua

  • @lyfranklin6418

    @lyfranklin6418

    2 жыл бұрын

    @@HarryDKH thats like saying just go and repair a pipe with with a picture of the plug being fixed

  • @lyfranklin6418

    @lyfranklin6418

    2 жыл бұрын

    @@HarryDKH yeah i spelt some stuff wrong but it doesnt explain but without actually knowing how to do it

  • @lowrhyan567

    @lowrhyan567

    2 жыл бұрын

    @@snoanashi1597 Id just like to interject for a moment what you are referring as "Lua" is in fact Luau, Roblox stopped using Lua5.1 some time ago and now it uses a "modified" version of it made from scratch by Roblox that they called Luau, many functions and even operators that you use in Roblox will not work in actual Lua.

  • @ahmad77mreborn29

    @ahmad77mreborn29

    2 жыл бұрын

    @@lyfranklin6418 there’s a difference between a pipe and programming

  • @ethansherwood5467
    @ethansherwood54674 жыл бұрын

    Just got back from High School to see a video by Dev King, usually means my nights going to be good

  • @imyellowteeth4691

    @imyellowteeth4691

    2 жыл бұрын

    Never been more right

  • @SadrightnauHaha

    @SadrightnauHaha

    2 ай бұрын

    sus

  • @randomguy3002

    @randomguy3002

    22 күн бұрын

    It has been 4 years you done with high school bro

  • @notmyus3rname781
    @notmyus3rname7813 жыл бұрын

    7:34 me when I look at my bank account

  • @otiopo7459

    @otiopo7459

    3 жыл бұрын

    good me

  • @anonymlol5038

    @anonymlol5038

    3 жыл бұрын

    lmao 😂

  • @cubecube333

    @cubecube333

    2 ай бұрын

    LMFAO

  • @momocraft365

    @momocraft365

    2 ай бұрын

    When i look and see i dont even have a bank since im too poor

  • @jules__byr
    @jules__byr4 жыл бұрын

    19:10 "if the data saves sexually, oh god, that's not what I said" lmaooooo

  • @haxis3764

    @haxis3764

    4 жыл бұрын

    LOLOLOLOLOLOLOLOLOLOLOL

  • @Zitho

    @Zitho

    4 жыл бұрын

    What was on his mind? lol

  • @thsra0013

    @thsra0013

    4 жыл бұрын

    Bruh you cant use socks like datastore

  • @BiassedYT

    @BiassedYT

    4 жыл бұрын

    Lol

  • @andrejprenkelushaj9499

    @andrejprenkelushaj9499

    4 жыл бұрын

    datasores store: type of sex, length of sex, good or bad sex (bool value)

  • @rickjr426
    @rickjr4264 жыл бұрын

    Thanks man, I'm more of a visual and auditory learner and this helped a lot. Much appreciation :)

  • @TheDevKing

    @TheDevKing

    4 жыл бұрын

    So glad it could help :)

  • @Bryce_TBS_Films

    @Bryce_TBS_Films

    4 жыл бұрын

    @@TheDevKing Do you think you could show us how to compress data and how too save models and stuff into the Data store system, Thanks and good video.

  • @4TH4RV

    @4TH4RV

    4 жыл бұрын

    @@Bryce_TBS_Films you can do it, its not very hard. You can store the assets in replicated storage and give them a unique key and then save those keys in datastore.

  • @samplescript2631

    @samplescript2631

    4 жыл бұрын

    @@Bryce_TBS_Films google it

  • @jbot2288

    @jbot2288

    2 жыл бұрын

    the only way to learn is with sight or listening besides brail

  • @Gen1us707
    @Gen1us707 Жыл бұрын

    Devking, i found you from your channel "TapWater" and watched one of your "current" videos which is your scripting our goofy ideas. Just when i thought, "okay, im a bad scripter and only know the basics and mostly just copy off scripts", you came in clutch and made me ACTUALLY LEARN all this advanced stuff of datastores, lerping, CFrame and i actually feel like an actual scripter. I just want to say thank you for what you're doing.

  • @user-xz9oo8di2s

    @user-xz9oo8di2s

    3 күн бұрын

    dont feel like an actual scripter, u r already an actual scripter :D

  • @Gen1us707

    @Gen1us707

    3 күн бұрын

    @@user-xz9oo8di2s thanks :) You are too!

  • @Nathanator
    @Nathanator4 жыл бұрын

    I just watched your video on CFrame, you’ve just earned a new subscriber!

  • @MyNameJeffOG
    @MyNameJeffOG3 жыл бұрын

    It took me 2 days to realize that i forgot to turn on api services

  • @ShiestySki

    @ShiestySki

    3 жыл бұрын

    R I P

  • @chricyan778

    @chricyan778

    3 жыл бұрын

    F

  • @MB-pw9hf

    @MB-pw9hf

    3 жыл бұрын

    F in the chat

  • @ryksi1904

    @ryksi1904

    3 жыл бұрын

    F

  • @snorrethignes5607

    @snorrethignes5607

    3 жыл бұрын

    @@MB-pw9hf f

  • @Arnold0404
    @Arnold04044 жыл бұрын

    one of the best tutorials out there, thx for explaining every single bit, its way more clear now, thx again

  • @awesomerobiin8612
    @awesomerobiin86123 жыл бұрын

    Thank you soo much for this tutorial. I had so much problems with saving data, watched all possible tutorials, but no one of them helped.

  • @nmhero4824
    @nmhero48244 жыл бұрын

    Thank you soo much for this tutorial I have literally been trying to do this on off for atleast 2 years and your tutorial was a great help!

  • @lolleavingthischannel6826
    @lolleavingthischannel68262 жыл бұрын

    Big thanks to you! Your tutorial series has really helped me in Roblox development! I am to a point where I can do a lot of things by myself! I've been making games in Roblox for 3 years and I spent 1 year actually learning from tutorials! Heh, oh boy I should have done what I'm doing now from the start. Would not have been so bad if I actually looked over tutorials instead of stealing scripts! :>

  • @dragonmaster4548
    @dragonmaster45484 жыл бұрын

    These videos are the only good scripting tutorial vids because I can understand him, and he tells us more detail then others.

  • @mool487

    @mool487

    3 жыл бұрын

    @Circuit Master not at all

  • @mool487

    @mool487

    3 жыл бұрын

    @Circuit Master im a pretty good scripter when it comes to certain things, but theres still a lot more for me to learn. not a single thing ive learnt has come from alvinblox, though. any time i try to learn something from him i fail and end up learning it somewhere else. a year ago i tried learning how to script, saw that alvin was popular and tried learning from him but ended up giving up. one day, someone recommended me peasfactory who ended up teaching me everything i needed to know to understand roblox lua. alvin barely taught me variables.

  • @mool487

    @mool487

    3 жыл бұрын

    @Circuit Master i guess we learn stuff differently

  • @ballisticbiscuit5706

    @ballisticbiscuit5706

    3 жыл бұрын

    @@mool487 the way i do it is, first i watch thedevking tutorial, and if i didn't understand his tutorial THEN ill go to alvinblox's tutorial. A lot of times devking leaves out a lot of details that i want or need to know, so my two options are 1. watch a shorter video of thedevking underexplaining the lesson but getting the point across or 2. watch an unreasonably long video of alvinblox explaining what i need to know and then re-explaining and overexplaining it 65 more times

  • @halalouis3814

    @halalouis3814

    2 жыл бұрын

    @@mool487 same lol

  • @outerspacedog
    @outerspacedog Жыл бұрын

    This is the best tutorial I could find, I've been making games without datastores for so long (just because I couldn't find a good video) THANK YOU

  • @thebrofessor2286
    @thebrofessor22862 жыл бұрын

    I know I am a bit late, but I just wanted to say that I love how you go in depth and actually explain what each function means and does rather than just telling us what to type and leaving us confused. I love your work, please never stop uploading! ♥

  • @dzleandrew4544

    @dzleandrew4544

    2 жыл бұрын

    I mean he kinda did explain it.. just not clear AHAHHAA

  • @bigamingplayer2409

    @bigamingplayer2409

    2 жыл бұрын

    Watch the beginner series first its very helpful and leads into understanding this video fully. As a person who has watched all his beginner videos, those videos are a MUST WATCH

  • @shadowredstone7123

    @shadowredstone7123

    Жыл бұрын

    the forshadowing :C

  • @angry_moose94

    @angry_moose94

    Жыл бұрын

    @@dzleandrew4544 If you need some clarifications, let me know. I can show you how to understand programming languages from the core. Once you understand how computers "understand" code, you can learn any programming language in 2 seconds. The computer science concepts will always remain the same, it's just the syntax that changes.

  • @Just_Being_Honest

    @Just_Being_Honest

    Жыл бұрын

    @@angry_moose94 I’m interested.

  • @wernkaros7517
    @wernkaros751710 ай бұрын

    Edit: After 3 long years of rewatching this tutorial and other tutorials, I've finally understood the concept of datastores. thanks buddy. I can now move on to the next scripting episode

  • @Haoyu_xD

    @Haoyu_xD

    4 ай бұрын

    bruh

  • @ransu6852

    @ransu6852

    Ай бұрын

    3 years.... to move to the next episode..... (meanwhile me watching 3 of em a day and getting the basics remembered lol)

  • @MisterCrowns
    @MisterCrowns3 жыл бұрын

    just got an ad saying that if i wanna get good at coding, stop with youtube tutorials. they clearly have never seen this mans channel.

  • @ss13games67
    @ss13games673 жыл бұрын

    OMG THANK U SO MUCH, ive tried so many other tutorials and they havent worked but yours has! thanks man

  • @SorryForBecomingHumanAgain9819
    @SorryForBecomingHumanAgain98192 жыл бұрын

    DAMN BRO EXTREME THUMBS UP ON EVERY ONE OF YOUR VIDEOS I SEE FROM NOW ON THIS HELPED ME SO MUCH TYSM

  • @sterlingmurphy6550
    @sterlingmurphy65504 жыл бұрын

    dude i was trying to save Cash and XP but i couldnt seem to know how to do it so i watched this video and you basically showed me and tot me! thank

  • @jaz_uu
    @jaz_uu4 жыл бұрын

    THANK YOU SO MUCH I FINALLY GOT THIS TO WORK THANKS TO YOU!

  • @KashTheKingYT
    @KashTheKingYT3 жыл бұрын

    Appreciate it man! Your tutorials are the best!

  • @poblethee51-a27
    @poblethee51-a27 Жыл бұрын

    THANK YOU SO MUCH. So I had a data saving script, and the reason it wasnt working was because when i was setting my data i was setting it on the client instead of the server, you are amazing, thank you!

  • @pepethejoker8809
    @pepethejoker88094 жыл бұрын

    Now we know that TheDevKing is aroused by saving and loading data. We understand u

  • @sleeping_mattress13

    @sleeping_mattress13

    3 жыл бұрын

    facts

  • @audrete6071

    @audrete6071

    3 жыл бұрын

    Lol

  • @Will_4560

    @Will_4560

    3 жыл бұрын

    lmaooo

  • @sylvanusdzotsi7152
    @sylvanusdzotsi71523 жыл бұрын

    22:07 dev king said "boom!", but i went "YES IT SAVED, I MADE A SAVE! THIS IS GROUNDBREAKING!" and i went crazy

  • @snowyy1944

    @snowyy1944

    2 жыл бұрын

    ok

  • @practicalcucumber1395

    @practicalcucumber1395

    Жыл бұрын

    ok

  • @pigglefruit
    @pigglefruit4 жыл бұрын

    NICE I'VE BEEN WAITING THANK YOU SO MUCH

  • @koteix.3747
    @koteix.37474 жыл бұрын

    ur scripting vids help so much :D

  • @electrododge8500
    @electrododge85002 жыл бұрын

    If you guys are making a game where every click or something is updating the leaderboard by +1 every click or something along the line, make sure if its a local script, you use the fireserver commands in order to send the new score to the server

  • @UnFroz3n

    @UnFroz3n

    2 жыл бұрын

    TYSM this helped me sooooo much

  • @CarcoDev

    @CarcoDev

    Жыл бұрын

    Leaving my reply here so that if I get stuck on a similar issue, I can come to this comment and understand it. Thanks!

  • @michaelswahla4927

    @michaelswahla4927

    10 ай бұрын

    oh nice

  • @LukeLolC

    @LukeLolC

    10 ай бұрын

    I thought my scripting lessons were over man.. thanks

  • @xdodko2
    @xdodko23 жыл бұрын

    one small mistake in the video, in the PlayerAdded function , when you're setting the local data variable, you need to set it as a table, so that multiple values can be saved into it. Instead of declaring it as 'local data', you need to declare it as 'local data = {}'

  • @myusernameskitty1230

    @myusernameskitty1230

    2 жыл бұрын

    what? my problem is that wins and cash are the same value

  • @screech2730

    @screech2730

    2 жыл бұрын

    @@myusernameskitty1230 that's what he just explained

  • @ragemode7231

    @ragemode7231

    2 жыл бұрын

    can you be a bit more clear, you said you need to put the values in a table but how are you meant to do like local Values = { Cash..... Gem..... }

  • @crypticyttalt7391

    @crypticyttalt7391

    2 жыл бұрын

    @@ragemode7231 its like a normal local but when you want to use either gems or cash you have to do Values.Cash or Values.Gem

  • @Rayhero

    @Rayhero

    2 жыл бұрын

    @@ragemode7231 I just see it as, you’re saving an empty single value if you just have one thing in the datastore, but since you have multiple which gets saved as a table, you then have to save an empty table to put values into

  • @ThatsValForYa
    @ThatsValForYa3 жыл бұрын

    This was the only tutorial i understood about Data Store, tysm!

  • @doggosaurs3489

    @doggosaurs3489

    3 жыл бұрын

    It's very hard to learn dataStores.

  • @InfinityBS
    @InfinityBS2 жыл бұрын

    bro dont apologize for long videos. if its 30 minutes long like this video was, that means its very helpful since we get all the details.

  • @justinsmith7832
    @justinsmith78324 жыл бұрын

    "Poofect!" That was adorable.

  • @evanbutfunnier2774
    @evanbutfunnier2774 Жыл бұрын

    3 years later, still never gets old

  • @AstralScript

    @AstralScript

    Жыл бұрын

    3 years and 3 months later, still never gets old

  • @evanbutfunnier2774

    @evanbutfunnier2774

    Жыл бұрын

    @@AstralScript ok

  • @East9211

    @East9211

    Жыл бұрын

    @@AstralScript 3 years, 3 months, and 11 days later, still never gets old

  • @mine1689

    @mine1689

    Жыл бұрын

    @@East9211 3 years, 3 months, and 18 days later, still never gets old

  • @michaelswahla4927

    @michaelswahla4927

    10 ай бұрын

    3 years and 5 months later, still never gets old

  • @toastedsocks1678
    @toastedsocks16783 жыл бұрын

    I've watched 3 different vids that worked but didn't help me understand it then I remembered you probably know, thanks for this video.

  • @MightyEFX
    @MightyEFX3 жыл бұрын

    love what youre doing, your amount of talking does test my patience tho lmao, but keep it up G, im not telling you to change anything

  • @skintaker1949
    @skintaker19494 жыл бұрын

    If you want to save a players objects, for example if they have a sword, or if they own a pet etc. you cannot do it in this way, instead you should make a value for it (i.e create a bool val inside the player) and save that value when the player leaves. You can then check that value when the player rejoins and give that item back. I learned this the hard way lol...

  • @rubina9271

    @rubina9271

    4 жыл бұрын

    Oh thanks for the explanation

  • @TapWaterRBLX

    @TapWaterRBLX

    4 жыл бұрын

    Lol yeah that’s probably the easiest way to do it

  • @chadchad7667

    @chadchad7667

    4 жыл бұрын

    For weapons u can also put a folder in the player and save all those weapons there and when a player joins the game you can make a script to give them all weapons in folder

  • @skintaker1949

    @skintaker1949

    4 жыл бұрын

    MyName IsPrivate well yes, but that doesn’t really explain how to save it. I explained this because no matter where I looked it was near impossible to find a video on how to save instances so I spent ages experimenting and using tips from other people and made this way, idk if it exists and if I just didn’t find it, but the good thing is, I am now an expert at datastores and know basically everything about it lol. Regarding your way, I’m not sure if ur referring to tools, and if u mean put tools in the backpack, is that what you meant?

  • @RumblingStarter

    @RumblingStarter

    Жыл бұрын

    @@TapWaterRBLX I heard that thedevking stole ur play button. Did you get it back?

  • @Akos-oe5lm
    @Akos-oe5lm4 жыл бұрын

    For me, it doesn't work. The code never gets to the point of printing "Data successfully saved" or "There was an error". I tested the code, and for some reason, the code gets stuck at these lines: local success, errormessage = pcall(function() levelDataStore:SetAsync(playerUserId, data) (yes i want to save levels that is why its level data store) end) I have no idea what i did wrong, i have rewritten the script multiple times already. And to top it all off, the code actually works with like a 1/5 chance of success so i am lost. If you could help with this, i would appreciate it!

  • @78bikerchick

    @78bikerchick

    4 жыл бұрын

    Try to test it in the actual game instead of using roblox studio, that's what fixed my problem :)

  • @Jack-jq9vl

    @Jack-jq9vl

    3 жыл бұрын

    @@78bikerchick Thanks so much, that worked for me too!

  • @nickster410

    @nickster410

    3 жыл бұрын

    If it is a string value, then it wont work. You cat datastore stringValues, but you can Set datastores to strings, Id recommend you read this: developer.roblox.com/en-us/api-reference/function/GlobalDataStore/SetAsync

  • @Bob-os7qf

    @Bob-os7qf

    3 жыл бұрын

    @TrizCoid thank you, i was wondering why it wasnt working xD

  • @manomedivine3473
    @manomedivine34733 жыл бұрын

    Congrats man I subbed from when you where 10k The comments pretty new though

  • @somedude0001
    @somedude0001 Жыл бұрын

    Very helpful! Thank you, Devking.

  • @deathstun1186
    @deathstun11864 жыл бұрын

    10:15 Async means Asynchronous. This is the opposite of Synchronous and it will wait to assign the variable till it gets it and wont do this at the same time as your game is running, it will do it on its own time and get back to you when it has it.

  • @BrandonShere

    @BrandonShere

    Жыл бұрын

    I know this is a old comment, but incase anyone else see's this and gets confused like I did. From my understanding of just researching it to make sure this comment was true, it actually yields the process until the data has been retrieved.

  • @Nathanator
    @Nathanator4 жыл бұрын

    What are you guys going to use DataStore for? Personally, I’m going to use it to save a player’s cars by using bool values.

  • @riokriftstrider8935

    @riokriftstrider8935

    4 жыл бұрын

    Gonna be using it for a fantasy rpg I plan to make but I still have more to learn before I do it

  • @qoix8320

    @qoix8320

    4 жыл бұрын

    I need to save my stando's from my jojo game

  • @xtragamez7195

    @xtragamez7195

    3 жыл бұрын

    for my difficulty chart obby

  • @myusernameskitty1230

    @myusernameskitty1230

    2 жыл бұрын

    gun saves, but rn it aint workin

  • @pupppy44
    @pupppy444 жыл бұрын

    Thanks for the tutorial. I'm getting more familiar with Lua by watching your vids.

  • @plankworld2539
    @plankworld25394 жыл бұрын

    Time to enjoy!

  • @SaxePrixon
    @SaxePrixon4 жыл бұрын

    I Would need to Watch This 100 times to learn and remember it

  • @user-cc1pm9ej8f

    @user-cc1pm9ej8f

    4 жыл бұрын

    If you would it would take over 2 days if you watch 24 hours a day... In that time you could've made a whole game!!!

  • @SaxePrixon

    @SaxePrixon

    4 жыл бұрын

    If you were to watch his tutorials you are not ready for Data Store, people doesn't know UserId, they don't understand it. TheDevKing goes right to the point without explaining each event and function to do this.

  • @cynthony_games9076

    @cynthony_games9076

    4 жыл бұрын

    @Poseidon Neptune yup. Dont worry anout memeorizing it but make sure you know what the script does and what it is used for. Datastores are used to save your data

  • @Spelo1

    @Spelo1

    3 жыл бұрын

    @@SaxePrixon Did you Just replied to your own comment?

  • @VortechBirb

    @VortechBirb

    3 жыл бұрын

    @@Spelo1 probably lol

  • @user-zl1qv6tf1o
    @user-zl1qv6tf1o Жыл бұрын

    For everyone saying "It doesn't work" It did just work for me, you most likely did something wrong. Take a good look at your output and fix the errors or just recheck your script. Edit: Also make sure you only have 1 leaderstats folder under the player. If theres 2 or more it means you have other active scripts running that are also creating leaderstats

  • @onlinepredator8544

    @onlinepredator8544

    Жыл бұрын

    lmao only comment that isnt from years ago

  • @Fizziepop
    @Fizziepop Жыл бұрын

    Loved this tutorial! Thank you! One question though - you said you were going to show how to autosave "later" - did you show it and I missed it? Or did you mean a later lesson?

  • @CR-hg5bl
    @CR-hg5bl4 жыл бұрын

    Good video! Thanks for your help with coding. :D

  • @woopstap1086
    @woopstap10864 жыл бұрын

    Really simple tip, but when you are Instancing, you can add a comma and then whatever you put after that will be the parent. Great Vid :)

  • @Simvoid230

    @Simvoid230

    3 жыл бұрын

    No, don't do this. That is a lot slower than just giving it a parent after the instance is created.

  • @qwerty_qwerty

    @qwerty_qwerty

    Жыл бұрын

    @@Simvoid230 I mean who cares about speed 🥱 It's just a bit more convenient

  • @Cosmoaxis
    @Cosmoaxis4 жыл бұрын

    By the way, changing properties of "Cash" is local. You need to use the developer console to do it on the server. Press F9 to open it. I hope I helped some people 😉

  • @kepiblop

    @kepiblop

    3 жыл бұрын

    5 months late but you can say /console too!

  • @UnFroz3n

    @UnFroz3n

    2 жыл бұрын

    Mmaxo 2 years late and I have nothing to say lol

  • @roatninthethird

    @roatninthethird

    Жыл бұрын

    @@kepiblop 2 years and 5 months late and i also have nothing to say

  • @dy7660

    @dy7660

    Жыл бұрын

    @@roatninthethird 100 years late and i like anime

  • @NoodlesAreYummy1199

    @NoodlesAreYummy1199

    Жыл бұрын

    inf years late and im glitched

  • @amateur-programmer
    @amateur-programmer2 жыл бұрын

    Thanks dude, you saved me from trial and erroring the entire thing.

  • @alexandrusd1140
    @alexandrusd114011 ай бұрын

    Bro u are the best u explain everything,hope you the best

  • @P0KEBLOX
    @P0KEBLOX4 жыл бұрын

    Hey, I was having problems with mine loading data until I added the 2nd parameter. Which I think is a newer feature data = myDataStore:GetAsync(playerUserId, cash)

  • @Tommy-hl2ic

    @Tommy-hl2ic

    4 жыл бұрын

    Is your cash variable capitalized? If it is, then capitalize cash

  • @mrriku9209

    @mrriku9209

    3 жыл бұрын

    you probably found the problem but you have to call the "cash" or anything else. for example if cash is member of leader stats them write "leaderstats.Cash" just call it

  • @estebansnidmena7332

    @estebansnidmena7332

    2 жыл бұрын

    thank you so much that worked

  • @addiebuss9060
    @addiebuss90603 жыл бұрын

    I was so worried about DataStores because they look super complicated but this made it a lot easier to understand!

  • @Nutsaq2222

    @Nutsaq2222

    Жыл бұрын

    HOW IS THYIS NOT HARD

  • @linartulaj3588

    @linartulaj3588

    Жыл бұрын

    @@Nutsaq2222 I find it so hard to memorize it

  • @YelowBananaGamer2
    @YelowBananaGamer215 күн бұрын

    rewatched this after one year, "TO EASY!", seriously though you are a life saver :D

  • @snorrethignes5607
    @snorrethignes56072 жыл бұрын

    YAY, UR THE BEST, I HAVE TRIED FOR 2 MONTHS, FINALLY!

  • @jonathanlok6384
    @jonathanlok63844 жыл бұрын

    Async actually means asynchronous. When an async function is called it will run on a different thread. Async has nothing to do with synchronization like the way you mentioned it.

  • @Asiimdoe

    @Asiimdoe

    2 жыл бұрын

    Mb getasync just means get a sync?

  • @thetrickyitch7179
    @thetrickyitch71794 жыл бұрын

    Really appreciate this video - Hugely educational. Anyone ever figure out the cause of the error he received? Very frustrating that the response was something like "OK, ummm...yea...I'm just going to ignore it." I follow this exactly, I get an error on the exact same line, and my script doesn't run.

  • @practicalcucumber1395

    @practicalcucumber1395

    Жыл бұрын

    He gave you a solution. Did you try if data then?

  • @RaesedDigital
    @RaesedDigital2 жыл бұрын

    So yea I know nothing about coding, but this actually explained alot and I have a working data store. And I'm good with changing the values now so I can actually make it what I want

  • @hsnahmdibrhm
    @hsnahmdibrhm3 жыл бұрын

    Great tutorial 👍👍🏿

  • @dragonmaster4548
    @dragonmaster45484 жыл бұрын

    I feel like a three year old while watching this.

  • @yelezi7950

    @yelezi7950

    4 жыл бұрын

    why?

  • @dragonmaster4548

    @dragonmaster4548

    4 жыл бұрын

    i dont remember why lol

  • @TeeHeeWinning

    @TeeHeeWinning

    4 жыл бұрын

    Yelezi cuz of the guys voice

  • @yunakang7498

    @yunakang7498

    4 жыл бұрын

    lolol

  • @blingwithdatice7657

    @blingwithdatice7657

    4 жыл бұрын

    LMFAOOO

  • @tylerdoesathing
    @tylerdoesathing4 жыл бұрын

    could you make a video on how to create a script that changes other values and saves it worldwide on player's actions? for example: a ban system but you can ban players without that player being in the game. in my thought, you would need to create a value and save the value to stay there for all servers. how would i do that?

  • @beedrillking4023

    @beedrillking4023

    2 жыл бұрын

    game.Players.PlayerAdded:Connect(function() if player.Name == "PlayerName" then player:Kick("reason") end end)

  • @practicalcucumber1395

    @practicalcucumber1395

    2 жыл бұрын

    @@beedrillking4023 he can just change his name. Getting his id and banning/kicking him when he joins should be better

  • @beedrillking4023

    @beedrillking4023

    2 жыл бұрын

    @@practicalcucumber1395 yup 4 months ago i was an idiot

  • @ta1g481
    @ta1g4814 жыл бұрын

    Nice :) you are funny sometimes and i like that i enjoyed this video yea and thanks for everything it works :))

  • @thebudgetdev6591
    @thebudgetdev65912 жыл бұрын

    so like i have literally no idea how tf someone uses a datastore and they scare the hell outta me, thanks for the tips!

  • @gonnadie4351
    @gonnadie43513 жыл бұрын

    3:24 "Basically you're getting a DataStore" - TheDevKing 2019

  • @gonnadie4351

    @gonnadie4351

    3 жыл бұрын

    @@TBHfaneto ohhh right

  • @nineveh17

    @nineveh17

    3 жыл бұрын

    I love when he repeats stuff

  • @gonnadie4351

    @gonnadie4351

    3 жыл бұрын

    @@nineveh17 ok

  • @maxo7674
    @maxo76743 жыл бұрын

    I've seen this like 10 times. I still can't understand, so this is it

  • @FusionsAharon

    @FusionsAharon

    2 жыл бұрын

    bRUH

  • @dinoguy8052

    @dinoguy8052

    20 күн бұрын

    same but ill figure it out eventually

  • @360sauce7
    @360sauce72 жыл бұрын

    Congrats on 400K

  • @jacoobio
    @jacoobio3 жыл бұрын

    This was the best tutorial ever.

  • @therandomnova
    @therandomnova3 жыл бұрын

    im having problems with line 30 game.Players.PlayerRemoving:Connect(function(player) can you paste the whole script in description?

  • @WoahItsKris

    @WoahItsKris

    3 жыл бұрын

    local datastoreservice = game:GetService("DataStoreService") local mydatastore = datastoreservice:GetDataStore("mydatastore") local data game.Players.PlayerAdded:Connect(function(plr) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = plr local XP = Instance.new("IntValue") XP.Name = "XP" XP.Parent = leaderstats local PlrId = "Player_"..plr.UserId local success, errormessage = pcall (function() Data = mydatastore:GetAsync(PlrId) end) if success then XP.Value = Data --load things end end) game.Players.PlayerRemoving:Connect(function(plr) local PlrId = "Player_"..plr.UserId data = plr.leaderstats.XP.Value local success, errormessage = pcall(function() mydatastore:setAsync(PlrId, data) end) if success then print("Data Saved") else warn("Error! "..errormessage) end end)

  • @TB86375

    @TB86375

    3 жыл бұрын

    @@WoahItsKris did that work for you?

  • @WoahItsKris

    @WoahItsKris

    3 жыл бұрын

    @@TB86375 Yeah, you might have to fix a little of it though.

  • @anakinskywalker2629
    @anakinskywalker26293 жыл бұрын

    See this is my problem, you say that if I don’t understand it I have to watch the beginners, but the thing is, I understand it, I watched it, but I don’t remember it.

  • @canilo_7672

    @canilo_7672

    3 жыл бұрын

    Practice makes perfect that is litteraly what i struggle with too

  • @randomguy3002
    @randomguy300221 күн бұрын

    Has been 4 years yet this tutorial is still the best

  • @smileyboi1205
    @smileyboi12053 жыл бұрын

    Very informative video!

  • @jerickoctaviano4774
    @jerickoctaviano47744 жыл бұрын

    there is no error on output and when i leave it says "Data Successfully save!" and when i play again the data not saving. Please help

  • @thishe0

    @thishe0

    4 жыл бұрын

    Data does not save in studio, you need to make your game public and play like that Sorry for the late reply

  • @NewsOnQueue

    @NewsOnQueue

    4 жыл бұрын

    Turn on api in studio and make sure you have internet. If you have api turned on it will save from studio

  • @masterlegend2944

    @masterlegend2944

    4 жыл бұрын

    The Dreaming Journal doesn’t matter he will get an error if API isn’t enabled

  • @masterlegend2944

    @masterlegend2944

    4 жыл бұрын

    Jerick Octaviano Check so that you did exactly as in the video and when your currency valu change in the game make sure that it changes in the server not on the client due to filtering enabled with stops players from hacking their money in your games hope this helped

  • @alphatv8017

    @alphatv8017

    4 жыл бұрын

    i think you changed the cash while in client mode

  • @77_seven
    @77_seven4 жыл бұрын

    "Get a sink"

  • @coopjava

    @coopjava

    3 жыл бұрын

    LOL

  • @eeeeeeeeeeeeeeeeeeeeeeeeee53

    @eeeeeeeeeeeeeeeeeeeeeeeeee53

    3 жыл бұрын

    “Sink the data”

  • @BABAPLAYTOOMUCH
    @BABAPLAYTOOMUCH Жыл бұрын

    ngl I doubted this tutorial I thought it wasn’t good. But after hours of confusion I was really desperate so I clicked on the tutorial and it cleared so many things up. Obviously there are some mistakes but you have helped me a lot

  • @mcohen8025
    @mcohen80253 жыл бұрын

    THANK YOU SO MUCH every other video i watched including Alvin blocks did not work but your did

  • @Michael01OnRBLXmore
    @Michael01OnRBLXmore4 жыл бұрын

    can you do multiple datastore? Like theres a cash datastore, theres a vehicle datastore a datastore for storing vehicles you've bought/earned. EDIT: I watched the entire video. You made it a table for multiple data to be saved.

  • @sintulichao3066

    @sintulichao3066

    4 жыл бұрын

    hey i know im 5 days late did you figure out your game? im trying to do the same for over 3years now im too dumb to understand i always fail could you share please?

  • @bigchungus14hvh12

    @bigchungus14hvh12

    2 жыл бұрын

    @@sintulichao3066 watch the video

  • @thatrobotguy7963
    @thatrobotguy79633 жыл бұрын

    Me: **Following instructions to perfection because I already rewrote the datastore 5 times** TheDevKing: Now press play to test. **Script works** Me: **Presses play to test** My script: *Haha funni game go brrrrrr*

  • @thatrobotguy7963

    @thatrobotguy7963

    3 жыл бұрын

    @ItzEthan I fixed it like a couple of hours later, it is really finicky.

  • @tigerthegreat9912

    @tigerthegreat9912

    2 жыл бұрын

    @@thatrobotguy7963 I know it’s been 9 months but do you remember what you did?

  • @thatrobotguy7963

    @thatrobotguy7963

    2 жыл бұрын

    @@tigerthegreat9912 Make sure you spell things correctly

  • @tigerthegreat9912

    @tigerthegreat9912

    2 жыл бұрын

    @@thatrobotguy7963 Ok ill check. Fast response btw.

  • @lyfranklin6418

    @lyfranklin6418

    2 жыл бұрын

    @@thatrobotguy7963 still got the code script? cuz i wanna go over it and i see what i did wrong since i keep checking everything and i dont see a problem in it and my error message wont give me anything that is a actual error message except the one telling me that i got a error in my script

  • @htandetuaung7238
    @htandetuaung7238 Жыл бұрын

    i was so close to giving up i even stoped watching but then i got my mind focused and finished the vid thank you for the awesome vids btw

  • @rubina9271
    @rubina92714 жыл бұрын

    Thanks for the video, I'll watch it soon am still on module scripts rn

  • @almanaque7187
    @almanaque71872 жыл бұрын

    Íncrivel! Queria que estivesse em português mas mesmo assim está ótimo. Muito Obrigado! 👍👏

  • @timmyismyfavoriteidol

    @timmyismyfavoriteidol

    2 жыл бұрын

    it means Incredible! I wish it were in Portuguese but it's still great. Thank you so much!

  • @almanaque7187

    @almanaque7187

    2 жыл бұрын

    @@timmyismyfavoriteidol Yes

  • @ana_s
    @ana_s3 жыл бұрын

    you can also do: local success, data = pcall(datastore.GetAsync, datastore, playerUserId) and it will be the same thing but it will be shorter and you will have a local variable

  • @gamingwithrealnader2901
    @gamingwithrealnader2901 Жыл бұрын

    At first when I was watching the video I was super confused and just couldn't focus or understand but when I watched it the second time I understood everything super more well then the last time I watched it you were right Dev all I had to do was just rewatch it and I would understand it thank you for the advice!

  • @2smart195
    @2smart1952 жыл бұрын

    i spendt 2 months feeling demotivated because i couldnt figure out how to save multible variables, thank you very much!

  • @RumblingStarter

    @RumblingStarter

    Жыл бұрын

    Did you watch the tables video

  • @necrowave8975
    @necrowave89754 жыл бұрын

    LMAO HE SAID "Sexually" LMFAOOOOoOoOooOoOo

  • @TapWaterRBLX

    @TapWaterRBLX

    4 жыл бұрын

    Necrowave wait what when lol

  • @necrowave8975

    @necrowave8975

    4 жыл бұрын

    @@TapWaterRBLX 19:10 "if success so if the data saves sexually succes- oh god" turn on captions xd

  • @4TH4RV

    @4TH4RV

    4 жыл бұрын

    yeah sexually is so funny guys. lmao cant stop wheezing

  • @andriyuandres1293
    @andriyuandres12934 жыл бұрын

    Can you do one for a base so players in my game can save their base’s

  • @BatyaChad
    @BatyaChad Жыл бұрын

    Omg dude so cool tutorial thank you very much!!!

  • @DoubleSJoker_13
    @DoubleSJoker_132 жыл бұрын

    Easy datastore tutorial, I finally figured out why my data wasn’t loading until I saw this

  • @Skan_Dev
    @Skan_Dev4 жыл бұрын

    "stick that bad boy in there" lmaoo sound wrong

  • @regonite1495

    @regonite1495

    4 жыл бұрын

    ajwkdflsdasdf

  • @onebeets

    @onebeets

    3 жыл бұрын

    Multiple sexual remarks made in the making of this video

  • @myusernameskitty1230

    @myusernameskitty1230

    2 жыл бұрын

    After he said sexually

  • @ipoststuff.2564
    @ipoststuff.25644 жыл бұрын

    27:10 7 1/2 years and a few seconds

  • @tist203
    @tist2032 жыл бұрын

    Is a table the only way you can save more than one type of data as demonstrated in the video? Or would you be able to save/call from two different tables.

  • @sadatwo
    @sadatwo3 жыл бұрын

    YAAASSS IT WASNT WORKING BEFORE IN STUDIO BUT WHEN. PLAYED MY GAME IN ROBLOX IT WORKS THANK YOU SO MUCH

  • @dad8102
    @dad81023 жыл бұрын

    27:00 Took u 7 and a half years to learn that jeez 😒 I have the utmost respect ✊ for that resilience

  • @yukengrowtopia

    @yukengrowtopia

    3 жыл бұрын

    Thanks Dad

  • @Shadowbirth1

    @Shadowbirth1

    3 жыл бұрын

    Dad what are you doing is this how you make money

  • @nineveh17

    @nineveh17

    3 жыл бұрын

    stop bullying my teacher dad

  • @DarkZ0l
    @DarkZ0l2 жыл бұрын

    So the script may not work for some of you, so my solution is that you should create a script in your leaderstats (have no data stores in leaderstats). Here's the script: local Players = game:GetService("Players") local DataStoreService = game:GetService("DataStoreService") local Saver = DataStoreService:GetDataStore("SaveLeaderstats") Players.PlayerAdded:Connect(function(player) local Data = nil local success, errormessage = pcall(function() Data = Saver:GetAsync(tostring(player.UserId)) end) if success then if Data then for i, v in pairs(Data) do if not player:FindFirstChild(i) then player:WaitForChild("leaderstats"):WaitForChild(i).Value = v else player:FindFirstChild(i).Value = v end end end else error(errormessage) end end) local function Save(player) local SavedData = {} for _, v in pairs(player.leaderstats:GetChildren()) do SavedData[v.Name] = v.Value end for _, v in pairs(player:GetChildren()) do if v:IsA("IntValue") then SavedData[v.Name] = v.Value end end local success, errormessage = pcall(function() Saver:SetAsync(tostring(player.UserId), SavedData) end) if not success then error(errormessage) end end Players.PlayerRemoving:Connect(Save) game:BindToClose(function() for _, v in pairs(Players:GetPlayers()) do Save(v) end end)

  • @vuhoang6257
    @vuhoang6257 Жыл бұрын

    I found that sometimes the data will be saved and sometimes it wont even though the script if correct if we test it via the test button at home of the studio. However, everything works normally when it comes to the test function of the studio. Hope this will be useful for the ones who watch this in the future

  • @blub2074
    @blub20743 жыл бұрын

    YES I LIVED TO THIS VIDEO AND I CAN WATCH IT FINALLY RN

  • @ItzDev9roblox
    @ItzDev9roblox4 жыл бұрын

    Nice tutorial!

  • @RandomThings1
    @RandomThings14 жыл бұрын

    amazing video, :)

  • @torbaz5930
    @torbaz59302 жыл бұрын

    Good tutorial, thank you for making it

  • @trickybrainpuzzles
    @trickybrainpuzzles2 ай бұрын

    Ahahaha I finally did it!!! I finally managed to save my leaderstats and from what I realised from this video, I can save anything!!! Ty very much your video was awesome and very usefull. Other youtube videos about this subject did not teach me anything, plus they didn't even work. I wanna thank you sooooooo much. I hope you have a great life!