Save Player Data with Roblox Datastores

DATASTORE EDITOR ► devforum.roblox.com/t/datasto...
MERCH ► shop.gnome.codes/
DISCORD ► / discord
TWITCH ► / gnomecode
TWITTER ► / gnomecoderblx
WEBSITE ► gnome.codes/
TIMESTAMPS ►
00:00 Intro
00:15 What is Datastore
01:27 Saving data
07:45 Loading data
12:26 Enabling API Services
14:00 Combining Leaderstats and Table data
15:43 Testing
16:16 Editing Datastores
16:58 Handling Server Shutdown
20:40 Outro

Пікірлер: 580

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

    I hope you had a wonderful Christmas with your family. Nice to see you still pushing out videos.

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

    I was never good with how to use tables so this helped a ton, thank you.

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

    GnomeCode is awesome. He makes actually good videos and explains almost everything. Keep it up GnomeCode!

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

    I was gonna bash on the gnome but this is pretty well-engineered. Wish i had you when i was learning how to code on Lua.

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

    i was about to add datastores and then i got the notification about a gnomecode video

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

    thank you gnomecode for making awesome tutorials and inspiring tons of great games!

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

    Thank you sir, never seen before the repeat until implementation

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

    working on a new game and stuff like thisll really help. thanks, gnome!

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

    great video as ever! One small point. I would save the Player.UserId to a variable when saving or you wont be able to use it if the first attempt fails as the player object will be gone by then. also, not too big a problem, but with normal datastores there is a limit of 1 read/write per 6 seconds to the same key

  • @GnomeCode

    @GnomeCode

    Жыл бұрын

    Excellent points, thanks griffo

  • @GalaxyedRainbow

    @GalaxyedRainbow

    Жыл бұрын

    @@GnomeCode your cool i like you

  • @CatgamerX

    @CatgamerX

    Жыл бұрын

    @@GnomeCode Can you make more doors?

  • @onewill8905

    @onewill8905

    6 ай бұрын

    Oh yeah for sure.. Everybody if you are reading this and feel a little lazy to do it, I promise its worth please follow his advice. It saved me. This is my script if you are confused on how to do it : local function plrLeaving(plr) if sessionData[plr.UserId] then local success = nil local errorMsg = nil local attempt = 1 repeat success, errorMsg = pcall(function() local plrUserId = plr.UserId database:SetAsync(plrUserId, sessionData[plr.UserId]) end) attempt += 1 if not success then warn(errorMsg) task.wait(3) end until success or attempt == 5 if success then print("Data saved for:",plr.Name) else warn("Unable to save for:",plr.Name) end end end

  • @Prillanator

    @Prillanator

    6 ай бұрын

    @@onewill8905 Please help, I get an error message "DataStoreService: ValueNotAllowed: Dictionary is not allowed in data stores. API: SetAsync, Data Store: PlacementBoards" Just before that line I print sessionData[player.UserId] which prints { ["Placement"] = -1 } I understand that its a Dictionary but I followed the code to a T. cant find where I made the error as to my understanding sessionData[player.UserId] = playerData and playerData = {["Placement"] = -1,}

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

    I love your content man i learn a lot

  • @2_toastedbagels
    @2_toastedbagels Жыл бұрын

    All the other videos I've watched show you how to do it but don't teach you so thank you gnomecode

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

    Thanks gnome for always doing tutorials on things we all know other roblox how to creators can never do due to their laziness

  • @TheOfficialPWP

    @TheOfficialPWP

    Жыл бұрын

    on god

  • @baconheadhair6938

    @baconheadhair6938

    2 ай бұрын

    ??

  • @7a8a13a5
    @7a8a13a5 Жыл бұрын

    yes the plugin edit video sounds great too :)

  • @dunialajla
    @dunialajla2 ай бұрын

    Great Video! I learnt a lot from this channel

  • @giraffeplays7065
    @giraffeplays70658 ай бұрын

    i did have to get some help for more leaderstats but your a lifesaver i spent hours on trying before hand thanks

  • @UnfortunateKera

    @UnfortunateKera

    7 ай бұрын

    Bro can you help me?

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

    This is something i've been looking for for aaagggeeess. you explained it perfectly. I have an idea for a tutorial. how about how to make a capture point system used in Domination gamemodes? i havent seen any videos on how to do that. i thought you would use Region3 but couldn't get much further as I am a beginner at coding. this would help me out a ton. thanks for the great video

  • @autisticbluesloth5244

    @autisticbluesloth5244

    11 ай бұрын

    every tenth of a second while a player is within 10 studs of a capture point you could update capture progress by an amount and do other visual rigamaro

  • @autisticbluesloth5244

    @autisticbluesloth5244

    11 ай бұрын

    to get wether or not a player is a certain distance you do (CapturePoint.Position - Character.Position).magnitude

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

    Best lua teacher!, A very calming voice too, Not a screechy 9 yr old, ty

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

    This was a great video to help make Datastores clear whilst waiting for Doors part 8. Also for Doors part 8 you should make the other place where everyone joins so you can go into a match with your friends and nobody else

  • @avgVar

    @avgVar

    Жыл бұрын

    He already did that with lobby elevator video

  • @GreatRamilYT

    @GreatRamilYT

    Жыл бұрын

    we even not added ambush, dark rooms and more... and you already want to take a step towards multiplayer?

  • @KoalaOnYT_

    @KoalaOnYT_

    Жыл бұрын

    @@GreatRamilYT it can already be multiplayer me and my pals have been playing through my version lol

  • @KoalaOnYT_

    @KoalaOnYT_

    Жыл бұрын

    @@GreatRamilYT plus we have all the bases we need to recreate the game

  • @GreatRamilYT

    @GreatRamilYT

    Жыл бұрын

    @@KoalaOnYT_ for now we have to finish some more banal things, but for now you can use the vip server or find a tutorial on how to make multiplayer

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

    These are so clutch tysm

  • @AlanShogs56
    @AlanShogs563 ай бұрын

    Great Video! Was Helpfull for me that dosent understand DataStores.

  • @Jappley
    @Jappley8 ай бұрын

    i dont know if i should feel insulted or honored when he calls me a gnome..

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

    Thank you so much for these tutorials! I honestly wouldn't know what to do with them. Btw, How do I make the Animate2 script compatible with scripts that load other animations?

  • @maaloyy_
    @maaloyy_9 ай бұрын

    You are helping so much! Liked and followed you!

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

    Bro this is insane

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

    yay, now I can Save Player Data with Roblox Datastores. jokes aside, this is an interesting take to see how to implement datastores with a more elaborate attempt

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

    This will be helpful and also I bought some of your merch

  • @Erolsaurus
    @Erolsaurus9 ай бұрын

    Thanks for the awesome tutorila!

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

    Yessir i needed this

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

    Hi gnomecode! Just asking if you could maybe make a tutorial of how to make a stealth/action FPS game like Entry Point! Its a fun concept and idea! where you can either sneak around to clear your main objective(s) or go full loud with shootie shooties and take out infinite waves of enemies while you clear or complete you objectives(s) with also saving levels and characters maybe?

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

    This is gonna be useful in my next game since its a long game!

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

    Can we all agree GnomeCode is the best roblox lua teacher on youtube!! 😊

  • @ummmyah

    @ummmyah

    Жыл бұрын

    Oh most definitely

  • @Giuyo

    @Giuyo

    Жыл бұрын

    yes it's an awesome thing.

  • @BasedOnBrian

    @BasedOnBrian

    Жыл бұрын

    Better than TheDevKing

  • @TheOfficialPWP

    @TheOfficialPWP

    Жыл бұрын

    yea the others are unhelpful

  • @wolf9903

    @wolf9903

    Жыл бұрын

    definetly last time i did a tutorial from TheDevKing it didnt even work

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

    I remember four years ago I was watching your scripting tuts. Now when I look at your profile you have nearly half a bil visits man. Ur the goat

  • @1TSAMELIA.
    @1TSAMELIA. Жыл бұрын

    I love all the games u make ! Teddy is my favourite!

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

    Hey GnomeCode, Love Your Content And Tutorials, i Was Wondering Could You Make A "How To Make A Game Like Roblox town" Series? I Would Love To Watch, Cheers!

  • @Afarmcow
    @Afarmcow6 ай бұрын

    i made a datastore but one of the variables doesn't work, when it changes, it doesn't fire the "changed" function

  • @polfailice1401
    @polfailice1401Ай бұрын

    Bro, u are the best teacher! I like to watching u. Sorry for my English 😅

  • @I-TIMOT
    @I-TIMOT8 ай бұрын

    you earned ez subscribe, bro

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

    so helpful!

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

    amazing tutorial !

  • @woke211
    @woke2119 ай бұрын

    such a helpful tutorial

  • @huy_nigera
    @huy_nigera2 ай бұрын

    Thank you, this really good working

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

    You should make a tutorial on how to add collectable gold into the Doors Tutorial series, I'd love to see it!

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

    what a coincidence, I was just looking for videos about datastore

  • @davidj-nv1sm
    @davidj-nv1sm9 ай бұрын

    thank you bro

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

    Question, in the beginning when setting the local variable for database “data” - how is this database created initially? Does simply setting a variable connecting to the service with a string name create it as well or just query/update it?

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

    are you going to continue your doors series? if so, can it be about the guiding light death messages? y'know the blue texts that tell you who you died to and how to survive it next time

  • @maleficentdemorgan
    @maleficentdemorgan3 ай бұрын

    OH IT WORKED TYSM

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

    Hey GnomeCode, I was making a cart ride game, but classic carts like you see in cart ride into Rdite for example are a bit too boring for me... I've seen alot of games with very interesting carts like in "Cart ride around nothing" or "Cart Ride Delivery Service", can you make a tutorial about those and how to make them? thanks!

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

    Out of the many KZreadrs that I've watched to learn Roblox scripting, you GnomeCode have taken 1st place. I appreciate you not skipping over or poorly explaining even the smallest of details that may be crucial for a beginner to understand. Thank you for the great video.

  • @GamingDude467

    @GamingDude467

    5 ай бұрын

    YES

  • @TT_and_CuzT

    @TT_and_CuzT

    5 ай бұрын

    I agree GnomeCode is #1

  • @BrightDay-tb8jj

    @BrightDay-tb8jj

    4 ай бұрын

    gnomecode you are da goat when i am a millionaire roblox-developer you can have 1 dollar

  • @BrightDay-tb8jj

    @BrightDay-tb8jj

    4 ай бұрын

    btw ur website is blocked for some reason :(

  • @rein5614
    @rein5614Ай бұрын

    nice! at the first half its completely fine and fully working. but at the combining leaderstats it got messed up and idk the problem even though i checked it like 5 times and i still could find the problem to fix why it cant save my data. pretty nice!

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

    Could you continue the Tower Defense Series for some additional towers (example: farms, commander, dj, vehicle support tower, barracks like in tower battles). If you do, then do it when you have time to do that. That's all.

  • @KhalidBro

    @KhalidBro

    10 ай бұрын

    create it urself. he cant help u with everything

  • @NeverEverFaceTheDark
    @NeverEverFaceTheDark4 ай бұрын

    currently, i could never write this, but i can actually understand it. you explain very well. is this all there is to a datastore? still puzzling over how profileservice seems like an infinitely complex version of this

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

    great video

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

    New series! "How to make a game like entry point" rn.

  • @Explosion_of_show-Dima
    @Explosion_of_show-Dima Жыл бұрын

    a good lesson, but it would be nice to look at old materials

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

    Hello GnomeCode! I’ve been someone who’s been watching your tutorials for a long time, and they’ve really helped me out! I’ve just been wondering, I think it would be pretty cool if you could show us how to make an rpg kind of game. It could get some views….

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

    Could you please consider doing a video on Ordered Data Stores?

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

    epico ty for saving my life

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

    I said im gonna look up datastores and this video notif poped up Gnome did you put cameras in my room!??! /j

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

    Cool video but why you don’t upload about teddy anymore?

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

    hey gnomecode, could you please make a video about remote functions (you made on remote events only), i don't think you made one and I think it might help many people

  • @doinic09

    @doinic09

    Жыл бұрын

    Well basically the only difference is with remote functions you can send information back to whatever is sending the function, so the client can send something to the server and the server can send something back based on the information the client sends. With remote events the sender can send information, but it can't receive information back.

  • @blackkray.
    @blackkray. Жыл бұрын

    I am interested in a standalone for editing datastores! Please gnomecode!!! Love your content btw!

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

    hey gnome code! i have a question. I saw your Custom Charecters Video and i was thinking if you could make the custom character apply only to one team. Thanks!

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

    Could you help with the footstep video? Nothing works when I do it all, not even the walking animation you made

  • @Erolsaurus
    @Erolsaurus9 ай бұрын

    How would I add more values, though?

  • @scratchthat8230
    @scratchthat823010 ай бұрын

    That's great and all but how do you store a list of values that I can table.Insert() more values into?

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

    Hey GnomeCode! I know it has been a month, and I don't know if anybody had asked this, but are you able to make a Murder Mystery type series?

  • @Foxie16713

    @Foxie16713

    Жыл бұрын

    Teddy series

  • @twizzitch3127

    @twizzitch3127

    Жыл бұрын

    @@Foxie16713 that's more Piggy like than MM

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

    Is there a way to use this to save the players clothing when they leave the game? Such as if they customised their character while in the game and then upon leaving it saved their clothes and accessories and all that, then when they rejoined it loaded all their clothes back on?

  • @_-Froggy-_
    @_-Froggy-_ Жыл бұрын

    I have an I for a new tutorial series it should be about the Roblox game Bigfoot by black spruce studio or you could do a monster island game if it's possible

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

    hes most likely on a hiatus on youtube, hes still active on roblox so dont worry.

  • @UsuarioCualquiera451
    @UsuarioCualquiera4518 ай бұрын

    AWESOME

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

    gnomeode, great vid, but i'm using the datastore for a clicker simulator but the clicks aren't saving it's adding them to the leaderboard but when i go back in the clicks are back at what they were, there's no errors or warnings please help

  • @27op0qks
    @27op0qks Жыл бұрын

    Hey GnomeCode, could you make a video with my suggestion? It's because i'm making a roblox horror game. There is a monster that will teleport around the map with 1 minute wait time, and when you look at it, it will pop up in your screen, play a sound and fade away.(I'm still a begginer in roblox studio, thats why i ask talented people like you!)

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

    Hey GnomeCode did you stop the Doors Tutorials Series?🤔 I am waiting for the next part...

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

    Can u make a tutorial on RunService bc I get confused all the time

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

    Can you do a tutorial on how to make a game like the mimic? You may have heard of it but if you can much appreciated!

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

    Hey i watching you since this channel 12k Please can you contuine the doors tutorial? Like: Seek, figure, objects, animations, Lobby. Maybe some people can do the other thing i can too but i cant make the seek ai and chase sceen same as tools to like lighters spawning in closets. I know you will do what you fans want. You are best.

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

    Very cool video

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

    GnomeCode i have something to ask you, can you make a game like steep steps, i really wanted a tutorial series for it..

  • @kokskoksowy
    @kokskoksowy10 ай бұрын

    why does the console say: Argument 1 missing or nil

  • @jaybird7667
    @jaybird76679 ай бұрын

    Hi, so in my games you unlock 5 different Billboard guis called “accolades” and I was wondering how I’d tweak this script to save those unlocked guis.

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

    Could you make a vid on how you make the mape choice like in tower heroes. That you have to make a server to choose a map

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

    TOO... MUCH... TO... MEMORIZE...

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

    Can you make a series of how to make a steep steps game..

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

    can you make a tutorial on a button masher with a camera for a keyboard key and if you win you live but if you fail you die kind of like the end of the doors seek chase kind of like that Doors X Fortnite (Collision Button Mash) if you can thank you!

  • @cloaker1903
    @cloaker19036 ай бұрын

    great video butt I have a problem with it Im trying to fire a remote event when player buyes something and finding stuff that player bought in session data table and giving it +1 I tried table.find output nil print(table.find(SessionData[plr.UserId], eventInvWho)) -- this is the code I tried I tried couple things too like adding new data when player buys it didnt work can anyone help me with it

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

    You should make another doors tutorial, for example... The Crucifix!

  • @7take93
    @7take9326 күн бұрын

    Thanks! How can I save data in multiple places within the game?

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

    it's been a month since he uploaded this video...

  • @joemama-vo5ew
    @joemama-vo5ew Жыл бұрын

    Hello GnomeCode, i saw that you have made a horror game like piggy recently, and i wanted to do that too, but i saw somethings are missing on the tutorials that i do need, thing like how a player gets selected as the monster, how the coin system works, how you can buy new skins, map voting stuff like that, so can you please make tutorials for that or help me out on my game, already big thanks🙂

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

    It didn't work and now it's 3am and I'm struggling on how the hell the leaderboard disappeared:,D

  • @capeknows9804

    @capeknows9804

    Жыл бұрын

    bruh

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

    Soooo the tower range is broken. When you click on and off and sell it doesnt go away? Any fix?

  • @kysics
    @kysicsАй бұрын

    yo bro but lets say like for example if i have a string value, if its changed in game like the actual value how do i save it? is tht possible

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

    just met you in bee swarm sim today!

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

    buddy... where did the doors tutorials go?!? No rush but I'm still very excitedly waiting. Get it, no rush... because that's the name of the doors monster... nvm

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

    what about saving with item like multiple type of guns/weapons how to apply to it?

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

    Hello I need help. Can you do a video where you need a certain amount of coins to change phases? For a example... I touch a part and if you have 200 coins then reset or die then you change phases with new attacks?

  • @baconheadhair6938

    @baconheadhair6938

    2 ай бұрын

    just check the player coins when they touch the part

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

    Can you make a tutorial on the death screen and boss defeat screen? Like how when you die in dark souls you get YOU DIE or like if you defeat a boss you get VICTORY ACHIEVED or something and is it possible to change the text like for example like instead of you died its Your mom or you can change it to Death Achieved?

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

    Hey gnome code are you okay I’ve seen that you haven’t uploaded in a while good luck can you also continue your does series if not that’s ok thabkyou

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

    Hey gnomecode I know there are a bunch of tutorials for this but can you make a short or long tutorial on how to make the backrooms in roblox?