I was never good with how to use tables so this helped a ton, thank you.
@GigaGnome Жыл бұрын
I hope you had a wonderful Christmas with your family. Nice to see you still pushing out videos.
@The_Real_Mini2 ай бұрын
bot
@GigaGnome2 ай бұрын
@@The_Real_Mini beep boop i am totally a bot
@keeguri Жыл бұрын
GnomeCode is awesome. He makes actually good videos and explains almost everything. Keep it up GnomeCode!
@The_Real_Mini2 ай бұрын
bot
@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 Жыл бұрын
Excellent points, thanks griffo
@GalaxyedRainbow Жыл бұрын
@@GnomeCode your cool i like you
@LuminousLynxz Жыл бұрын
@@GnomeCode Can you make more doors?
@onewill8905 Жыл бұрын
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 Жыл бұрын
@@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,}
@Martinchi Жыл бұрын
Out of the many KZbinrs 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.
@GamingDude46711 ай бұрын
YES
@TT_and_CuzT11 ай бұрын
I agree GnomeCode is #1
@BrightDay-tb8jj11 ай бұрын
gnomecode you are da goat when i am a millionaire roblox-developer you can have 1 dollar
@BrightDay-tb8jj11 ай бұрын
btw ur website is blocked for some reason :(
@dextertheio28574 ай бұрын
@@BrightDay-tb8jjwhat
@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 Жыл бұрын
He already did that with lobby elevator video
@GreatRamilYT Жыл бұрын
we even not added ambush, dark rooms and more... and you already want to take a step towards multiplayer?
@KoalaOnYT_ Жыл бұрын
@@GreatRamilYT it can already be multiplayer me and my pals have been playing through my version lol
@KoalaOnYT_ Жыл бұрын
@@GreatRamilYT plus we have all the bases we need to recreate the game
@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
@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.
@The_Real_Mini2 ай бұрын
bot
@YuinAstrophel2 ай бұрын
@@The_Real_Mini tf, you calling me a bot kid?
@The_Real_Mini2 ай бұрын
@@YuinAstrophel yes
@YuinAstrophel2 ай бұрын
@@The_Real_Mini weird
@Yuzum3o Жыл бұрын
i did have to get some help for more leaderstats but your a lifesaver i spent hours on trying before hand thanks
@UnfortunateKera Жыл бұрын
Bro can you help me?
@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 Жыл бұрын
on god
@baconheadhair69389 ай бұрын
??
@The_Real_Mini2 ай бұрын
bot
@DaAccountName Жыл бұрын
i was about to add datastores and then i got the notification about a gnomecode video
@aznya Жыл бұрын
It didn't work and now it's 3am and I'm struggling on how the hell the leaderboard disappeared:,D
@capeknows9804 Жыл бұрын
bruh
@DevlonReall4 ай бұрын
add it to player, not any other
@ishandaylath103526 күн бұрын
leaderstats must be lowercase
@huttle Жыл бұрын
Can we all agree GnomeCode is the best roblox lua teacher on youtube!! 😊
@ummmyah Жыл бұрын
Oh most definitely
@giuyo Жыл бұрын
yes it's an awesome thing.
@BasedOnBrian Жыл бұрын
Better than TheDevKing
@TheOfficialPWP Жыл бұрын
yea the others are unhelpful
@wolf9903 Жыл бұрын
definetly last time i did a tutorial from TheDevKing it didnt even work
@2_toastedbagels Жыл бұрын
All the other videos I've watched show you how to do it but don't teach you so thank you gnomecode
@scratchthat8230 Жыл бұрын
Best lua teacher!, A very calming voice too, Not a screechy 9 yr old, ty
@RichRBLX Жыл бұрын
working on a new game and stuff like thisll really help. thanks, gnome!
@waffle_doge5594 Жыл бұрын
thank you gnomecode for making awesome tutorials and inspiring tons of great games!
@The_Real_Mini2 ай бұрын
bot
@PoggersFloppaАй бұрын
Amazing video, I learned so much like how tables work and ipairs!
@halalouis3814 Жыл бұрын
The Script: local Players = game:GetService("Players") local RunService = game:GetService("RunService") local DatastoreService = game:GetService("DataStoreService") local database = DatastoreService:GetDataStore("PlayerData") local sessiondata = {} local DefaultData = { ["Dollars"] = 50 } local function PlayerAdded(player) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" local Dollars = Instance.new("NumberValue", leaderstats) Dollars.Name = "Dollars" local sucsess = nil local PlayerData = nil local attempt = 1 repeat sucsess,PlayerData = pcall(function() return database:GetAsync(player.UserId) end) if not sucsess then warn(PlayerData) task.wait(3) end attempt += 1 until sucsess or attempt == 5 if sucsess then print("Connected To Database") if not PlayerData then print("No User Data Found, Assigning Default Data") PlayerData = DefaultData end sessiondata[player.UserId] = PlayerData else warn("Unable To Get Data For User: "..player.Name) player:Kick("Unable To Load Your Data, Please Try Again Later! :D") end Dollars.Value = sessiondata[player.UserId].Dollars -- SYNC LEADERSTATS WITH DATASTORE Dollars.Changed:Connect(function() sessiondata[player.UserId].Dollars = Dollars.Value end) leaderstats.Parent = player end local function PlayerRemoved(player) if sessiondata[player.UserId] then local sucsess = nil local errorMsg = nil local attempt = 1 repeat sucsess, errorMsg = pcall(function() database:SetAsync(player.UserId, sessiondata[player.UserId]) end) if not sucsess then warn(errorMsg) task.wait(3) end attempt += 1 until sucsess or attempt == 5 if sucsess then print("Data Saved For User: "..player.Name) else warn("Data Unable To Save For User: "..player.Name) end end end local function ServerShutdown() if RunService:IsStudio() then return end print("Handling Server Shutdown") for i, plr in ipairs(Players:GetPlayers()) do task.spawn(function() PlayerRemoved(plr) end) end end Players.PlayerAdded:Connect(PlayerAdded) Players.PlayerRemoving:Connect(PlayerRemoved) game:BindToClose(ServerShutdown)
@daog_beast4151 Жыл бұрын
bro your a legend tysm
@halalouis3814 Жыл бұрын
@@daog_beast4151 no problem, btw if you need help scripting just ask me, i have quite a lot of experience
@Erolsaurus Жыл бұрын
@@halalouis3814 How would I add another leaderstat to this?
@Erolsaurus Жыл бұрын
@@halalouis3814 Now I'm confused. I added a second leaderstat and it worked, but I added a third one and the script stopped working. I went back to two, but it also didn't work.
@halalouis3814 Жыл бұрын
@@Erolsaurusmight be because roblox loads and unloads things weirdly, try using multi-threading
@Afarmcow Жыл бұрын
i made a datastore but one of the variables doesn't work, when it changes, it doesn't fire the "changed" function
@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
@Jappley Жыл бұрын
i dont know if i should feel insulted or honored when he calls me a gnome..
@The_Real_Mini2 ай бұрын
bot
@Jappley2 ай бұрын
@@The_Real_Mini bot
@dunialajla9 ай бұрын
Great Video! I learnt a lot from this channel
@LandonCotton22328 күн бұрын
awesome video! but i do have a question, is it possible to access a players saved data? like say "noob" had 50 dollars in my game would i be able to access "noobs" data and interact with it? like change his 50 to 100
@lolofuk87 Жыл бұрын
Thank you sir, never seen before the repeat until implementation
@FuntimeAG5 ай бұрын
I would suggest for conveniency if you wanna experiment first start off with the loading function and print out what you get because if something is wrong and it saves the wrong thing its a real pain to revert it every time.
@7a8a13a5 Жыл бұрын
yes the plugin edit video sounds great too :)
@AlanShogs569 ай бұрын
Great Video! Was Helpfull for me that dosent understand DataStores.
@MadnessNull Жыл бұрын
I said im gonna look up datastores and this video notif poped up Gnome did you put cameras in my room!??! /j
@hattinnh4 ай бұрын
Thank you for posting - learnt a lot!
@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 Жыл бұрын
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 Жыл бұрын
to get wether or not a player is a certain distance you do (CapturePoint.Position - Character.Position).magnitude
@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?
@polfailice14017 ай бұрын
Bro, u are the best teacher! I like to watching u. Sorry for my English 😅
@1TSAMELIAA Жыл бұрын
I love all the games u make ! Teddy is my favourite!
@nickkingpiggy2651 Жыл бұрын
This will be helpful and also I bought some of your merch
@jajaredgamer7462 Жыл бұрын
Cool video but why you don’t upload about teddy anymore?
@alex965t9 Жыл бұрын
I love your content man i learn a lot
@SergeantNooob Жыл бұрын
what a coincidence, I was just looking for videos about datastore
@GuidingLightIsBack21 күн бұрын
@GnomeCode I have a question, can you make it like a doors rift and saves whichever item is put in?
@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!
@AndersonDosGames Жыл бұрын
i accidentally closed the tab which i had this video open in and when i came back it was on the part where it was when i closed it, i guess youtube knows how to use Datastores too
@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?
@ghostlyn69 Жыл бұрын
Teddy series
@twizzitch3127 Жыл бұрын
@@ghostlyn69 that's more Piggy like than MM
@vroomgt57432 ай бұрын
This really helps for my game👍
@maaloyy_ Жыл бұрын
You are helping so much! Liked and followed you!
@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 Жыл бұрын
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.
@mrminion545 Жыл бұрын
This is gonna be useful in my next game since its a long game!
@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?
@Stupefy1111Ай бұрын
It works but when I make a script to increase the value it doest save that so i can only save on the server and its rlly confusing so someone pls help????
@IndevGames-sl9np4 ай бұрын
This guy is a goat tysm!
@Aang600 Жыл бұрын
These are so clutch tysm
@NeverEverFaceTheDark11 ай бұрын
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
@cryptex6709 Жыл бұрын
Bro this is insane
@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!)
@NukegamerboyRA Жыл бұрын
Gnome code how much robux do you think you should pay for a build? Assuming that it's a mid poly build and it's a small build
@SandrockYT3 ай бұрын
Amazing tutorial! earned a like and sub
@blandpotato545 Жыл бұрын
The script isn’t working for me. I copied everything in the script but it won’t save the cash value in my leaderstats between games
@diphenylmethane Жыл бұрын
same it just randomly decides when to save and always loads the default data only
@baconheadhair69389 ай бұрын
then you didn’t do it correctly brother
@itzdarkcy7141 Жыл бұрын
New series! "How to make a game like entry point" rn.
@itsrellw Жыл бұрын
Can you make a series of how to make a steep steps game..
@_-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
@froodlenoodleАй бұрын
[EDITED BECAUSE I FIGURED IT OUT] I think this code has an issue. The changed function for the dollars value is inside the playeradded function, which surely means it only connects if a player joins and their dollars value is changed at the exact same time? I'm not sure though as it worked for you in the video, but my code doesn't save changes i make to the dollars while playing. Edit: the issue isn't the script, it works absolutely brilliantly (although i still don't exactly understand how), its the fact you need to edit the players dollars value with a global script, otherwise it won't save.
@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!
@natsieee25 Жыл бұрын
GnomeCode i have something to ask you, can you make a game like steep steps, i really wanted a tutorial series for it..
@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 Жыл бұрын
create it urself. he cant help u with everything
@Acredition912Ай бұрын
I'm wondering if the attempts surpass 5 and the data is still not saved, isnt that will wipe out player's data?
@koainanis5840 Жыл бұрын
Hey GnomeCode did you stop the Doors Tutorials Series?🤔 I am waiting for the next part...
@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
@alejandrorivera9694 Жыл бұрын
it's been a month since he uploaded this video...
@lyftfn7870 Жыл бұрын
will you be doing the doors serie
@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….
@Bambuuck3 ай бұрын
So, I had a question which appeared after I implemented the script into my game (Great tutorial!), the question is how do I modify those leaderstats using other scripts? e.g. I got a leaderstat which is called "Tutorial completed" and its a boolValue and should become true when my tutorial is completed.
@KooIKid Жыл бұрын
do you know if you can make a murderer mystery type of game?
@huy_nigera8 ай бұрын
Thank you, this really good working
@joncepearce72932 ай бұрын
What if setting the player's data fails all five attempts? Isn't it safer to not check the attempt number at all?
@SafixBG Жыл бұрын
Hello GnomeCode! Remember when you did tutorials on how to make Doors Roblox? So... Can you make new Doors tutorials? Doors just added Crucifix, Skeleton Key, etc. Can you make tutorials?
@ghostlyn69 Жыл бұрын
You could of just said “hey gnomecode how can I fully rip off doors with nothing original”
@doinic09 Жыл бұрын
@@ghostlyn69 trueee
@Slimedev569 ай бұрын
TIP: if the code is not working, MAKE SURE you typed everything correctly, even the tiniest of errors could cause the script to fail.
@jstarandomdude9 ай бұрын
on the sample script he made (the one that makes dollars on the leaderboard appears) mine doesnt work? I even tried running print to see where it fails but it runs print meaning it just refuses to make folder called instance
@aqaisback95179 ай бұрын
leaderstats HAS TO BE NAMED "leaderstats" otherwise it will not work@@jstarandomdude
@TheCaptainGooey Жыл бұрын
Could you please consider doing a video on Ordered Data Stores?
@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!
@JOSUETUBER08 Жыл бұрын
GnomeCode make vídeo like: How to make doors delete past rooms and generate more. Like this
@ghostlyn69 Жыл бұрын
Learn how to code bro
@TheRecordium Жыл бұрын
so helpful!
@ExtraFerance Жыл бұрын
hes most likely on a hiatus on youtube, hes still active on roblox so dont worry.
@D3DO Жыл бұрын
just met you in bee swarm sim today!
@Domi-oz8fr Жыл бұрын
Yo gnomeCode what happened with the Doors Tutorial Series
@mrtmrv5873 Жыл бұрын
Can you make a shooter game series?
@alejandrorivera9694 Жыл бұрын
He needs to finish doors series first
@J3RiC3LL Жыл бұрын
That is actually a great idea I hope he does :) maybe after that he can maybe make a combat game like a sword fight game
@lukiraq Жыл бұрын
GnomeCode, is there a diffrent between wait() and task.wait() ?
@ghostlyn69 Жыл бұрын
Wait is just waiting a the amount of time when the computer reaches that line. Task.wait is when the computer waits for the script before the task.wait to execute if that makes sense. So waiting is just right when the game runs it waits the amount of time and task.wait is waiting for the rest of the code to fully execute before continuing
@tommarnt9 ай бұрын
task.wait() is delayed i think@@ghostlyn69
@boi875_RBLX Жыл бұрын
I recommend checking out DataStore2, as it is one of the best data store modules out there, many popular games uses it as it is really good at preventing dataloss and other bad things!
@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!
@itsksd10 күн бұрын
THANK YOU ALOTTTTTTTT
@Explosion_of_show-Dima Жыл бұрын
a good lesson, but it would be nice to look at old materials
@sewie2620 Жыл бұрын
Yessir i needed this
@maleficentdemorgan9 ай бұрын
OH IT WORKED TYSM
@kattykillz Жыл бұрын
You should make a tutorial on how to add collectable gold into the Doors Tutorial series, I'd love to see it!
@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 Жыл бұрын
Could you help with the footstep video? Nothing works when I do it all, not even the walking animation you made
@Erolsaurus Жыл бұрын
Thanks for the awesome tutorila!
@4DF2007Official Жыл бұрын
ngl gnome code is easy to understand because he speaks at a normal pace, compared to the “oksotodaywehavethedatastore”
@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🙂
@Firesy9 ай бұрын
Can you make a video on how to edit datastore manually?
@blackkray. Жыл бұрын
I am interested in a standalone for editing datastores! Please gnomecode!!! Love your content btw!
@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
@jsnotlout3312 Жыл бұрын
Ah yes, my arch nemesis, Datastores. It took me a good month or two to finally get it down. I was so confused at first.
@ItsNoobManYT Жыл бұрын
A month?!
@jsnotlout3312 Жыл бұрын
@@ItsNoobManYT Yeah, its really confusing when you get far into it
@elmerald210 Жыл бұрын
you probably wont see this, but can you make a ambush ai for the doors tutorials.