![]() ![]() Make a new server script, and paste this code into it:įor everyone seeing this post I recommend learning from youtubers or from the profile service page. This would be fine if you explained the example code in depth. Regarding your tutorial, you have copied the ENTIRE example code that Profile Service has. A module script is MUCH better than putting it in a regular script. Ignoring the fact that you completely misunderstood how the default data store works… The reason youtubers put the functions and everything else in a module script is so they can use it in other scripts. Profile Service just coded it correctly and made it a module which was easy to use. DataStoreService is fine but requires skill to make correctly and to a custom module. My friend and I have once made a game that peaked at 3k players. ![]() Data will not fail and wipe any players’ data. Please tell me if I did anything wrong in this tutorial, I’ll edit it right away!įirst of all the default data store is completely fine. It’s always best to use the latest and greatest stuff though. ![]() DataStore2 works great and is used in games like Dungeon Quest. If you do use DataStore2, you don’t need to change to Profile Service. You might be wondering about why I didn’t make a tutorial about DataStore2, and that’s because DataStore2 is older than Profile Service. So many big games use Profile Service, including Mad City, Bedwars, and so many more. Since data doesn’t load right away, you’ll have to instead listen for when the object will get added. So before trying to display a player’s possible equipped weapon, you can do this: :Connect(function() This is for client scripts loading information like displaying their equipped weapon for example. Now after all data is loaded, you’ll see a value called “DataLoaded” is created. Now, go to the Profile Service script you made, and at the very top of the player added function, you put: repeat task.wait(0.1) until not player:FindFirstChild("ProfileLoadoutHold") Then after your if statement for success of loading their data, you delete ProfileHoldOut. Then, when they first join, make a new value inside the player called, “ProfileHoldOut.” At the very bottom of the if statement for success of loading their data, you do: YourDataStore:RemoveAsync(player.UserId) Step 4 If you’ve been using the default data saving method and your game is kind of popular, then you’ll want to use the data store you’ve been using and disable it from saving. Now, just save your player’s data the same way you would with the default data saving method, by doing something like this: = Local ProfileStore = ProfileService.GetProfileStore( Local Players = game:GetService("Players") Updating the template will not include missing template values Make a new server script, and paste this code into it: - ProfileTemplate table is what empty profiles will default to. But if there’s already a FREE resource out there, why not use it? A bunch of big games use it too. There’s so much research and experience needed to make your own data store module that you’d have to dedicate months of hard work and research. ![]() Well, the issue with that is it’ll take up so much valuable time. Why can’t I just setup my own data store? But in this tutorial, it won’t be, because you’re not figuring this out on your own. Trust me, it happens to so games that get suddenly popular- too many! I wanted to make this tutorial because I had to figure out how to use Profile Service, and it was hard. When your game gets enough traffic, the default data saving method will start to fail saving. If you don’t save user data with ProfileService or DataStore2, then you’re saving data wrongly. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |