Everyone heere is simply talking about his voice, however, that is a fundementally normal part about being a human. growing up, is one of it. the fact that you are commenditing on this vide osi very rude and very not sigma and htsi ssomething that awthat shoulndt aef aw;elkj awlekfj;wlkej ;lawf jsig
Summary (if anyone has issue): - DataStore:GetAsync(plr.UserId, value) -- returns the value saved within that player's UserId, (will be nil if that player has no previous data saved) so you might want to save that particular value, as that player's leaderstats value or something - DataStore:SetAsync(plr.UserId, value) -- changes the value of the value saved within that player's UserId, so you might want to use the Players.PlayerRemoving event so that every time a player leaves, you can set their value as what they last had -pcall(function() -- so you basically wrap a function in a pcall to make that there is no data lost, while trying to send a request to roblox's DataStoreService
@@RedmanHarfire Lets look at an example : Lets say we have a function that adds up numbers local function Add(num1, num2) Sum = num1 + num2 return Sum end basically what you return, will become the value that you get from that function. In other words, if i was to write : local myNum = Add(2, 3) The value of Add(2, 3) would be 5, since the sum of the 2 numbers is returned. And therefore, myNum will he equal to 5. P.S : Hey man, data stores is a slightly more of an advanced topic, so I think it would be better for you if you watched alvin's beginner series videos on functions and returning values and all that, he explains it really well
Why is mine giving > {...} in the output... This is my script: local DataStoreService = game:GetService("DataStoreService") local DataStore = DataStoreService:GetDataStore("DataStore1") local Template = {Coins = 50} game.Players.PlayerRemoving:Connect(function(player) wait(5) pcall(function() DataStore:SetAsync(tostring(player.UserId), Template.Coins) end) end) game.Players.PlayerAdded:Connect(function(player) pcall(function() local data = DataStore:GetAsync(tostring(player.UserId)) print(data) end) end)
Yes bro! Keep making these videos they help me so much. I get better and better every day because of you, like no joke they are so helpful. Please keep making more!
Always been my go to for scripting tutorials. I finally have grasped data stores with your tutorial after like 5 years of trying to learn scripting properly... only to learn about profile service and datastore2 😭Could you make a tutorial on that? Thanks for the amazing tutorials over the years by the way.
Someone please correct me if I am wrong, but at 11:31 when he makes the deepcopy of the table, isn't he saving the non-copied table "Template" using SetAsync? Or is the premise that if you want to manipulate the data, it should be a deep-copied table?
Correct, Copying the template isnt done so he Could put it in the set async, it was for so you could use the data later.He Said hes doing it for safety and i will probably too. Now a nice way of using that deepcopied table would be by continuing the if Data == nil statement with else. That statement checks if its players First time joining the game, and if it is, it sets the players values to the values from any table you wrote(template),so if we Said else after it, it would basically mean, if they join for the second or higher time. And then you would write DataStore:SetAsync(Player.UserId,Template).Now you would also Need to have a way of making coins value or something else bigger trought the table. Also if u arleady know to make a leaderstats and some values in it for a game, i could teach you how to easily save it even after it has updated, you would Need to use game.Players.PlayerRemoving, which is a event which fires once the player leaves the game. So if u have any auestions ask😅Sorry for a long message
@@oleNikolic No, I actually know how to make a "DataStore". I am watching as many videos as I can to learn how to ACTUALLY make a DataStore, like from the "Implementing Player Data and Purchasing Systems" document on the Roblox API/Documentation. But unfortunately, there is no RUclips video that goes THAT in-depth, which I guess is to be expected. So I just siphon through these beginner tutorials to try and learn new things.
@@oleNikolic hey when i tried to print my points, it times the value by 3 and if i try print my money, it just says "nil". btw i replicated the exact code just a few changed to the template but i know what im doing. any help?
I'm confused about how this saves the data. Whenever the person leaves what saves the data to the datastore? I can't get mine to work, I'm just trying to save a leaderstat.
alvinblox I have a question can you make a tutorial on how you can make throwable knife like how you can throw a knife in murder mystery 2 I tried doing it my self but every time I do there's something missing im not sure what it is that's thanks!
Hey man, keep the good work, but i need your help, i don't know how to make a simulator, i have the map build but i don't know how to do breakables, orbs, buying areas. I only have a pet system from your tutorial that are realy good btw, if you can responde if you make this series it would be nice!
but how can i like make that if u for example made a quest and earned coins it wills store and u can actually buy smth with the coins and they get minus but also the thing u bought will get stored
Omg since when did we need to pay with USD to get plugins?? I can't afford Data store editor since USD is far superior than my currency 😭this is diabolical
It is extremely cringe. Though I am kind of glad in the long run, because I convinced myself that Moon Animator is NOT worth the $30 and instead learned Blender for animating.
Make a part that is at the height of the players head when the crouching anim plays and then when u use the keybind for crouch tween between the main camera and the part you created for the camera.
damn, your voice really changed since i saw you in 2016. Good work man! keep going.
yeee
who wouldve guessed lol
Everyone heere is simply talking about his voice, however, that is a fundementally normal part about being a human. growing up, is one of it. the fact that you are commenditing on this vide osi very rude and very not sigma and htsi ssomething that awthat shoulndt aef aw;elkj awlekfj;wlkej ;lawf jsig
@@gradientblob1014 tf ?
@@gradientblob1014 Testing if my reply goes through
It's been 10 years I think when I watched your old tutorials, you made me a good luau scripter thank you
Summary (if anyone has issue):
- DataStore:GetAsync(plr.UserId, value) -- returns the value saved within that player's UserId, (will be nil if that player has no previous data saved) so you might want to save that particular value, as that player's leaderstats value or something
- DataStore:SetAsync(plr.UserId, value) -- changes the value of the value saved within that player's UserId, so you might want to use the Players.PlayerRemoving event so that every time a player leaves, you can set their value as what they last had
-pcall(function() -- so you basically wrap a function in a pcall to make that there is no data lost, while trying to send a request to roblox's DataStoreService
almost. pcall just prevents your script from throwing an error if there’s a problem with the request
ohh thanks for the heart and clearing that up for me!
i want to know something what is returning a value ????
@@RedmanHarfire Lets look at an example : Lets say we have a function that adds up numbers
local function Add(num1, num2)
Sum = num1 + num2
return Sum
end
basically what you return, will become the value that you get from that function. In other words, if i was to write :
local myNum = Add(2, 3)
The value of Add(2, 3) would be 5, since the sum of the 2 numbers is returned. And therefore, myNum will he equal to 5.
P.S : Hey man, data stores is a slightly more of an advanced topic, so I think it would be better for you if you watched alvin's beginner series videos on functions and returning values and all that, he explains it really well
Why is mine giving > {...} in the output...
This is my script:
local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("DataStore1")
local Template = {Coins = 50}
game.Players.PlayerRemoving:Connect(function(player)
wait(5)
pcall(function()
DataStore:SetAsync(tostring(player.UserId), Template.Coins)
end)
end)
game.Players.PlayerAdded:Connect(function(player)
pcall(function()
local data = DataStore:GetAsync(tostring(player.UserId))
print(data)
end)
end)
Yes bro! Keep making these videos they help me so much. I get better and better every day because of you, like no joke they are so helpful. Please keep making more!
Welcome back alvin i see that you cameback hopefully you will post more tutorials for us. Keep up with the good work 😀😀
Nicely explained as always, Alvin!
This is one of the best Data Store tutorials I've seen, keep it up.
Nice vid, had a problem with the data store stuffs... Thanks mate 👍
i was really confused about this, watched this now i don't think i'll ever face a problem when making datastores!
Thank you so much for making this tutorial! I’m still learning and this helped me a lot.
Always been my go to for scripting tutorials. I finally have grasped data stores with your tutorial after like 5 years of trying to learn scripting properly... only to learn about profile service and datastore2 😭Could you make a tutorial on that? Thanks for the amazing tutorials over the years by the way.
You are such a good scripter. Amazing video, keep up the good work
Nice video!
Nice video Alvin
omgg ur back
I am going to read what i have written logically if there is an error. Thanks AlvinBlox 👍
Someone please correct me if I am wrong, but at 11:31 when he makes the deepcopy of the table, isn't he saving the non-copied table "Template" using SetAsync? Or is the premise that if you want to manipulate the data, it should be a deep-copied table?
Correct, Copying the template isnt done so he Could put it in the set async, it was for so you could use the data later.He Said hes doing it for safety and i will probably too. Now a nice way of using that deepcopied table would be by continuing the if Data == nil statement with else. That statement checks if its players First time joining the game, and if it is, it sets the players values to the values from any table you wrote(template),so if we Said else after it, it would basically mean, if they join for the second or higher time. And then you would write DataStore:SetAsync(Player.UserId,Template).Now you would also Need to have a way of making coins value or something else bigger trought the table. Also if u arleady know to make a leaderstats and some values in it for a game, i could teach you how to easily save it even after it has updated, you would Need to use game.Players.PlayerRemoving, which is a event which fires once the player leaves the game. So if u have any auestions ask😅Sorry for a long message
@@oleNikolic No, I actually know how to make a "DataStore". I am watching as many videos as I can to learn how to ACTUALLY make a DataStore, like from the "Implementing Player Data and Purchasing Systems" document on the Roblox API/Documentation. But unfortunately, there is no RUclips video that goes THAT in-depth, which I guess is to be expected. So I just siphon through these beginner tutorials to try and learn new things.
@@oleNikolic hey when i tried to print my points, it times the value by 3 and if i try print my money, it just says "nil". btw i replicated the exact code just a few changed to the template but i know what im doing. any help?
I'm confused about how this saves the data. Whenever the person leaves what saves the data to the datastore? I can't get mine to work, I'm just trying to save a leaderstat.
That's cause you have to use another script to call on the datastore
@@dereckhernandezrivera3473 scripting is so complicated 😭
@@theorderofthedarkoats3288fr
It dint work because this video din't show us how to save the data when player leaves the game, might aswell look into other video that shows how to
hey! how i do a countdown with data store? like, when you leave and rejoin the timers dont reset?
alvinblox I have a question can you make a tutorial on how you can make throwable knife like how you can throw a knife in murder mystery 2
I tried doing it my self but every time I do there's something missing im not sure what it is that's thanks!
Hey man, keep the good work, but i need your help, i don't know how to make a simulator, i have the map build but i don't know how to do breakables, orbs, buying areas. I only have a pet system from your tutorial that are realy good btw, if you can responde if you make this series it would be nice!
This is Useful but it would be More Useful if there was a Simple vid on How to save The Player's Coins
but how can i like make that if u for example made a quest and earned coins it wills store and u can actually buy smth with the coins and they get minus but also the thing u bought will get stored
Omg since when did we need to pay with USD to get plugins?? I can't afford Data store editor since USD is far superior than my currency 😭this is diabolical
It is extremely cringe. Though I am kind of glad in the long run, because I convinced myself that Moon Animator is NOT worth the $30 and instead learned Blender for animating.
You should make a video explaining pcalls and xpcalls
What's the point of making the players userID a string?
for some reason when i used this my data connected with someone elses but i joined on an alt and it wasnt connected for it
Can you make a tutorial on lowering the camera in first person mode when you do the crouch mechanic?
Make a part that is at the height of the players head when the crouching anim plays and then when u use the keybind for crouch tween between the main camera and the part you created for the camera.
@@plodethtrello9687Works but changing camera offset is faster
do you just reupload a new script version on the same topic every year, i swear you’ve made like five other videos like this one
Mind posting the completed script in des i had to delete it cause you switched up too fast, and it was to gumbled
accidentally clicked on the RUclips notification, wsp
Your voice really changed since i last watched your videos 5 years ago 😅
this is very useful
Why do you need a deepcopy function, can't you just do "Data = template:Clone()"
You cant clone a table, that only works for instances in workspace
does it actually work though?
HII I USED TO WATCH YOU WHEN I WAS 9
Hey can we get the link to the plugin you used for the data viewing
Added to the description.
@@AlvinBlox thanks
I’m here
how did you make a deep copy
Added to description
The link in the description does not help
First
First comment 😊
Hey dude! Wanna collab?
why would someone with 485k subscribetswanna collab with some kid with 350 subscribers🤣🤣🤣🤣🤣
@@BlastedOreo123AY! WHAT DID YOU SAY???
First