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

Поділитися
Вставка
  • Опубліковано 14 гру 2024

КОМЕНТАРІ • 1,3 тис.

  • @garrettsmith1818
    @garrettsmith1818 3 роки тому +636

    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.

  • @4stray
    @4stray 3 роки тому +210

    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 роки тому +9

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

    • @lyfranklin6418
      @lyfranklin6418 3 роки тому +9

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

    • @lyfranklin6418
      @lyfranklin6418 3 роки тому +3

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

    • @lowrhyan567
      @lowrhyan567 3 роки тому +4

      @@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 3 роки тому

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

  • @Gen1us707
    @Gen1us707 Рік тому +21

    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.

    • @MdMuq
      @MdMuq 6 місяців тому +2

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

    • @Gen1us707
      @Gen1us707 6 місяців тому

      @@MdMuq thanks :) You are too!

    • @thatszizo
      @thatszizo 6 місяців тому

      @@MdMuq nice guy fr

    • @OldReichInfo
      @OldReichInfo 5 місяців тому

      @@MdMuq i still dont know how to use CFrame after 2 month of learning

  • @ethansherwood5467
    @ethansherwood5467 5 років тому +161

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

  • @rickjr426
    @rickjr426 5 років тому +122

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

    • @TheDevKing
      @TheDevKing  5 років тому +27

      So glad it could help :)

    • @Bryce_TBS_Films
      @Bryce_TBS_Films 5 років тому +3

      @@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 роки тому +5

      @@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 роки тому +1

      @@Bryce_TBS_Films google it

    • @jbot2288
      @jbot2288 3 роки тому +3

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

  • @Nathanator
    @Nathanator 5 років тому +33

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

  • @wernkaros7517
    @wernkaros7517 Рік тому +8

    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 11 місяців тому

      bruh

    • @ransu6852
      @ransu6852 7 місяців тому

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

    • @MOHA_1484.
      @MOHA_1484. 5 місяців тому

      Help I did everything in the tutorial and it doesnt work

  • @notmyus3rname781
    @notmyus3rname781 4 роки тому +170

    7:34 me when I look at my bank account

    • @otiopo7459
      @otiopo7459 3 роки тому +5

      good me

    • @anonymlol5038
      @anonymlol5038 3 роки тому +4

      lmao 😂

    • @Frfr680
      @Frfr680 8 місяців тому

      LMFAO

    • @momocraft365
      @momocraft365 8 місяців тому

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

    • @Xianity-m6q
      @Xianity-m6q Місяць тому +1

      @@momocraft365 jus say you're underage bro

  • @jules__byr
    @jules__byr 4 роки тому +376

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

    • @haxis3764
      @haxis3764 4 роки тому +20

      LOLOLOLOLOLOLOLOLOLOLOL

    • @Zitho
      @Zitho 4 роки тому +47

      What was on his mind? lol

    • @thsra0013
      @thsra0013 4 роки тому +14

      Bruh you cant use socks like datastore

    • @BiassedYT
      @BiassedYT 4 роки тому +4

      Lol

    • @andrejprenkelushaj9499
      @andrejprenkelushaj9499 4 роки тому +22

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

  • @dragonmaster4548
    @dragonmaster4548 5 років тому +20

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

    • @mool487
      @mool487 4 роки тому

      @Circuit Master not at all

    • @mool487
      @mool487 4 роки тому

      @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 4 роки тому

      @Circuit Master i guess we learn stuff differently

    • @ballisticbiscuit5706
      @ballisticbiscuit5706 4 роки тому

      @@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 3 роки тому

      @@mool487 same lol

  • @MisterCrowns
    @MisterCrowns 3 роки тому +4

    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.

  • @InfinityBS
    @InfinityBS 3 роки тому +4

    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.

  • @MyNameJeffOG
    @MyNameJeffOG 4 роки тому +63

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

  • @Hypnostor
    @Hypnostor 4 місяці тому +2

    Bro, I was so fucking burnt out from scripting and couldnt understand ANYTHING and I found you from a recommendation and I'm actually getting somewhere now. ur so chill and following with you and learning with u is so easy bro so tysm I think I have hope in myself now bro 😭😭

  • @electrododge8500
    @electrododge8500 3 роки тому +17

    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

    • @Flopper54
      @Flopper54 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 Рік тому

      oh nice

    • @LukeLolFC
      @LukeLolFC Рік тому

      I thought my scripting lessons were over man.. thanks

  • @pepethejoker8809
    @pepethejoker8809 4 роки тому +122

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

  • @thebrofessor2286
    @thebrofessor2286 3 роки тому +34

    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 3 роки тому

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

    • @casyyalo3
      @casyyalo3 2 роки тому +1

      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 2 роки тому

      the forshadowing :C

    • @angry_moose94
      @angry_moose94 Рік тому +1

      @@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 Рік тому +2

      @@angry_moose94 I’m interested.

  • @justinsmith7832
    @justinsmith7832 4 роки тому +20

    "Poofect!"
    That was adorable.

  • @Arnold0404
    @Arnold0404 4 роки тому +7

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

  • @randomguy3002
    @randomguy3002 6 місяців тому +2

    Has been 4 years yet this tutorial is still the best

  • @sylvanusdzotsi7152
    @sylvanusdzotsi7152 4 роки тому +25

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

  • @xdodko2
    @xdodko2 4 роки тому +62

    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 3 роки тому

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

    • @screech2730
      @screech2730 3 роки тому +3

      @@myusernameskitty1230 that's what he just explained

    • @shortstorysforall
      @shortstorysforall 3 роки тому +1

      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 роки тому +1

      @@shortstorysforall 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 роки тому

      @@shortstorysforall 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

  • @evanbutfunnier2774
    @evanbutfunnier2774 Рік тому +8

    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 Рік тому

      3 years and 5 months later, still never gets old

  • @skintaker1949
    @skintaker1949 5 років тому +8

    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 5 років тому +1

      Oh thanks for the explanation

    • @TapWaterRBLX
      @TapWaterRBLX 5 років тому +2

      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 2 роки тому

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

  • @SaxePrixon
    @SaxePrixon 4 роки тому +9

    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 4 роки тому +1

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

    • @VortechBirb
      @VortechBirb 4 роки тому

      @@Spelo1 probably lol

  • @Cosmoaxis
    @Cosmoaxis 4 роки тому +19

    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 4 роки тому +2

      5 months late but you can say /console too!

    • @Flopper54
      @Flopper54 2 роки тому +1

      Mmaxo 2 years late and I have nothing to say lol

    • @roatninthethird
      @roatninthethird 2 роки тому

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

    • @dy7660
      @dy7660 2 роки тому

      @@roatninthethird 100 years late and i like anime

    • @NoodlesAreYummy1199
      @NoodlesAreYummy1199 Рік тому

      inf years late and im glitched

  • @lolleavingthischannel6826
    @lolleavingthischannel6826 2 роки тому +6

    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! :>

  • @ImNotAWall
    @ImNotAWall Місяць тому +1

    this is the hardest thing he has ever taught me

  • @sterlingmurphy6550
    @sterlingmurphy6550 4 роки тому +5

    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

  • @TofuYT
    @TofuYT 3 роки тому +2

    4 months of scripting, this is the 13th time revisting this video -_-

  • @gonnadie4351
    @gonnadie4351 3 роки тому +7

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

  • @SorryForBecomingHumanAgain9819
    @SorryForBecomingHumanAgain9819 2 роки тому

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

  • @woopstap1086
    @woopstap1086 5 років тому +7

    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 4 роки тому +5

      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 2 роки тому

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

  • @awesomerobiin8612
    @awesomerobiin8612 4 роки тому +1

    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.

  • @justanotherzackery
    @justanotherzackery 4 роки тому +7

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

  • @2smart195
    @2smart195 3 роки тому +1

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

  • @Nathanator
    @Nathanator 5 років тому +8

    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 роки тому +2

      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 роки тому +2

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

    • @xtragamez7195
      @xtragamez7195 3 роки тому

      for my difficulty chart obby

    • @myusernameskitty1230
      @myusernameskitty1230 3 роки тому

      gun saves, but rn it aint workin

  • @outerspacedog
    @outerspacedog 2 роки тому

    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

  • @nmhero4824
    @nmhero4824 4 роки тому +3

    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!

  • @Alanel745
    @Alanel745 2 роки тому +3

    5:41 "We're gonna go ahead and go ahead"

  • @user-zl1qv6tf1o
    @user-zl1qv6tf1o 2 роки тому +5

    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

  • @poblethee51-a27
    @poblethee51-a27 2 роки тому +1

    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!

  • @deathstun1186
    @deathstun1186 4 роки тому +11

    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 2 роки тому +2

      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.

  • @Yessirified
    @Yessirified Місяць тому

    Thanks 30 minutes ago i had no idea what DataStores are and How to save players data But now i do!

  • @thatrobotguy7963
    @thatrobotguy7963 4 роки тому +13

    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 4 роки тому

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

    • @tigerthegreat9912
      @tigerthegreat9912 3 роки тому

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

    • @thatrobotguy7963
      @thatrobotguy7963 3 роки тому

      @@tigerthegreat9912 Make sure you spell things correctly

    • @tigerthegreat9912
      @tigerthegreat9912 3 роки тому

      @@thatrobotguy7963 Ok ill check. Fast response btw.

    • @lyfranklin6418
      @lyfranklin6418 3 роки тому

      @@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

  • @ss13games67
    @ss13games67 3 роки тому

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

  • @jonathanlok6384
    @jonathanlok6384 4 роки тому +39

    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 3 роки тому

      Mb getasync just means get a sync?

  • @snorrethignes5607
    @snorrethignes5607 3 роки тому

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

  • @dragonmaster4548
    @dragonmaster4548 5 років тому +3

    Omg you made new video. Can you make weekly vids??

  • @KashTheKingYT
    @KashTheKingYT 4 роки тому +1

    Appreciate it man! Your tutorials are the best!

    • @LeeOmai
      @LeeOmai 3 місяці тому

      yoo kash wsg!

  • @dragonmaster4548
    @dragonmaster4548 5 років тому +57

    I feel like a three year old while watching this.

  • @pigglefruit
    @pigglefruit 5 років тому +1

    NICE I'VE BEEN WAITING THANK YOU SO MUCH

  • @addiebuss9060
    @addiebuss9060 3 роки тому +4

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

    • @Nutsaq2222
      @Nutsaq2222 2 роки тому

      HOW IS THYIS NOT HARD

    • @linartulaj3588
      @linartulaj3588 2 роки тому

      @@Nutsaq2222 I find it so hard to memorize it

    • @TRQZed
      @TRQZed 4 місяці тому

      @@linartulaj3588 don't memorize it

  • @koteix.3747
    @koteix.3747 5 років тому +1

    ur scripting vids help so much :D

  • @Akos-oe5lm
    @Akos-oe5lm 4 роки тому +14

    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 роки тому +2

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

    • @Jack-jq9vl
      @Jack-jq9vl 4 роки тому

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

    • @nickster410
      @nickster410 4 роки тому

      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 4 роки тому

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

  • @MightyEFX
    @MightyEFX 3 роки тому

    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

  • @TheGamingClovers
    @TheGamingClovers 3 роки тому +3

    Can anyone help? The script works fine with a single variable but not when I put in a table. It says attempt to index number with number

  • @sadatwo
    @sadatwo 4 роки тому

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

  • @maxo7674
    @maxo7674 3 роки тому +6

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

  • @manomedivine3473
    @manomedivine3473 4 роки тому

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

  • @77_seven
    @77_seven 4 роки тому +17

    "Get a sink"

  • @jacoobio
    @jacoobio 4 роки тому +2

    This was the best tutorial ever.

  • @anakinskywalker2629
    @anakinskywalker2629 4 роки тому +7

    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 4 роки тому +2

      Practice makes perfect that is litteraly what i struggle with too

  • @360sauce7
    @360sauce7 2 роки тому

    Congrats on 400K

  • @cxxn.e
    @cxxn.e 6 місяців тому +3

    every developer's worst nightmare..

    • @Dogey_Dogger
      @Dogey_Dogger 3 місяці тому +1

      and pathfinding

    • @cxxn.e
      @cxxn.e 3 місяці тому

      @@Dogey_Dogger lmao

  • @ThatsValForYa
    @ThatsValForYa 4 роки тому

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

  • @jerickoctaviano4774
    @jerickoctaviano4774 5 років тому +32

    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

    • @dumbcalamitychild
      @dumbcalamitychild 4 роки тому +12

      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 роки тому +10

      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 роки тому +2

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

    • @masterlegend2944
      @masterlegend2944 4 роки тому +3

      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 роки тому +1

      i think you changed the cash while in client mode

  • @toastedsocks1678
    @toastedsocks1678 4 роки тому

    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.

  • @thetrickyitch7179
    @thetrickyitch7179 4 роки тому +5

    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.

  • @CR-hg5bl
    @CR-hg5bl 5 років тому +1

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

  • @wonsole
    @wonsole 5 місяців тому +3

    [19:12] "if the data saves sexually" 🙏😭

  • @plankworld2539
    @plankworld2539 5 років тому +1

    Time to enjoy!

  • @P0KEBLOX
    @P0KEBLOX 4 роки тому +5

    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 роки тому +2

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

    • @mrriku9209
      @mrriku9209 4 роки тому

      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 3 роки тому

      thank you so much that worked

  • @hsnahmdibrhm
    @hsnahmdibrhm 3 роки тому +1

    Great tutorial 👍👍🏿

  • @tylerdoesathing
    @tylerdoesathing 4 роки тому +4

    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 3 роки тому

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

    • @practicalcucumber1395
      @practicalcucumber1395 2 роки тому +1

      @@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

  • @zaki._.010
    @zaki._.010 Рік тому

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

  • @necrowave8975
    @necrowave8975 5 років тому +11

    LMAO HE SAID "Sexually" LMFAOOOOoOoOooOoOo

    • @TapWaterRBLX
      @TapWaterRBLX 5 років тому +1

      Necrowave wait what when lol

    • @necrowave8975
      @necrowave8975 5 років тому +1

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

    • @4TH4RV
      @4TH4RV 4 роки тому +4

      yeah sexually is so funny guys. lmao cant stop wheezing

    • @oof9248
      @oof9248 3 місяці тому

      devking is aroused by saving data

  • @trickybrainpuzzles
    @trickybrainpuzzles 8 місяців тому

    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!

  • @dad8102
    @dad8102 4 роки тому +3

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

    • @ryuken_02
      @ryuken_02 4 роки тому

      Thanks Dad

    • @Shadowbirth1
      @Shadowbirth1 3 роки тому

      Dad what are you doing is this how you make money

    • @nineveh17
      @nineveh17 3 роки тому

      stop bullying my teacher dad

  • @somedude0001
    @somedude0001 Рік тому

    Very helpful! Thank you, Devking.

  • @therandomnova
    @therandomnova 4 роки тому +4

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

    • @WoahItsKris
      @WoahItsKris 4 роки тому +2

      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)

    • @taibarrett1st
      @taibarrett1st 4 роки тому

      @@WoahItsKris did that work for you?

    • @WoahItsKris
      @WoahItsKris 4 роки тому

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

  • @htandetuaung7238
    @htandetuaung7238 2 роки тому

    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

  • @bblkdot
    @bblkdot 3 роки тому +3

    Hmmm…what if I am making a “Find The Items” game and I need to save the items to the inventory?

    • @bblkdot
      @bblkdot 3 роки тому

      @M.A green cube Gaming im his cat🐱

  • @pupppy44
    @pupppy44 4 роки тому +1

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

  • @jacoobio
    @jacoobio 4 роки тому +3

    Is this outdated?

  • @amateur-programmer
    @amateur-programmer 2 роки тому

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

  • @Michael01OnRBLXmore
    @Michael01OnRBLXmore 4 роки тому +3

    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 3 роки тому

      @@sintulichao3066 watch the video

  • @milchbanane9087
    @milchbanane9087 2 роки тому +1

    "So this is GetASync, what it means is..... GetASync" Nice.

  • @ipoststuff.2564
    @ipoststuff.2564 4 роки тому +8

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

  • @playformers1238
    @playformers1238 3 роки тому +1

    Doctor: You have only 29 minutes to live.
    Me:

  • @Skan_Dev
    @Skan_Dev 4 роки тому +13

    "stick that bad boy in there" lmaoo sound wrong

  • @TimelyTopicsYT
    @TimelyTopicsYT 3 роки тому +1

    Really annoying how he kept deleting and undoing making it way more complex but I really do appreciate the video 😭

  • @DarkZ0l
    @DarkZ0l 2 роки тому +2

    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)

  • @ta1g481
    @ta1g481 4 роки тому

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

  • @almanaque7187
    @almanaque7187 3 роки тому +13

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

    • @timmyismyfavoriteidol
      @timmyismyfavoriteidol 3 роки тому +1

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

    • @almanaque7187
      @almanaque7187 3 роки тому +2

      @@timmyismyfavoriteidol Yes

  • @b_simming
    @b_simming 2 роки тому

    Great tut DevKing... lol I almost thought my script didn't work, i am getting this!

    • @badr_8415
      @badr_8415 2 роки тому

      change local leaderstats = Instance.new("IntValue") by local leaderstats = Instance.new("IntValue", player)

  • @ana_s
    @ana_s 4 роки тому +5

    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

  • @BABAPLAYTOOMUCH
    @BABAPLAYTOOMUCH 2 роки тому

    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

  • @andriyuandres1293
    @andriyuandres1293 4 роки тому +3

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

  • @RaesedDigital
    @RaesedDigital 3 роки тому

    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