I have a problem, so basically i use coins and when the player picks up the coin it gives an error : Data is not valid member of Player So basically how do i get the data folder?
great tutorial, but i really want to point out how much I appreciate the entire part starting at 11:32 I'm very new to doing this, but having an explanation on what each line does is incredibly helpful to grasping this entire concept.
If your Table values aren't saving, it's probably because your table has mixed integer and string indexs, read the top of ProfileService. I hope this helps anyone so they don't bang their head into the wall for 3 days like i just did
so im trying to make it so that when you use a tool (which is in your starterpack) and you click you get 1 sip, the problem is the sip value isnt going up ive used both local and regular scrips im not sure whether or not im needing to use remote events?, heres my code local serverScriptService = game:GetService("ServerScriptService") local DataManager = require(serverScriptService:WaitForChild("Modules"):WaitForChild("DataManager")) script.Parent.Activated:Connect(function(player) local profile = DataManager.Profiles[player] if not profile then return end profile.Data.Sips += 1 player.leaderstats.Sips.Value = profile.Data.Sips end) Update, if youre using tools to gain points with a local script, use remote events
Hi, I see you are quite good at this and I need some advice. I can also use this script to automatically save the time spent on the server, I've been struggling with this for a long time, but no script ever works for me. It always shows me a problem in the datastore and I don't know what to do about it. Does saving also work for more things, for example saving time and also saving money in the game? thank you very much
Great tutorila but i have a issue here is my error : ServerScriptService.Module.ProfileService:1714: [ProfileService]: Profile template not set - ProfileStore:LoadProfileAsync() locked for this ProfileStore
@@AmoraScripting hey ik its a year later and stuff but how would i save one value that's in the leaderstats folder and then have more values that aren't leaderstats? edit: used common sense and figured it out myself thx for the tutorial
im trrying to make a obby but with saving obby progression would this work for me with the obby or would i be better off writing a regular leaderstats script for it becuase when i join and re load it doesnt save? (I got it to save!)
hey, nice tutorial! i was wondering if it would be worse if i made a maybe "statsHandler", and make functions like "player.profile.Data.Exp.Changed:Connect(function())" to make it so when the player gets exp, i dont need to update it inside the own script, would that work?
those waitforchilds are... oof, that's a lot of em, if you want to just load them via dot/bracket indexing, you can do game.Loaded to wait until everything is loaded.
Thanks but, how do I make it work with a remote event whenever the remote event fires it loads a data value that it added. But if the player joins the data doesn't load for some reason.
@@AmoraScripting im just trying to store 2 variables ive created in a local script on the server so that when someone leaves and rejoins i can access their user specific variable values and display them
yo on the part stuff where when u fire the prox prompt why do I ge tan error attempt to index nil with instance Im erroring on this line local profile = dataManager.Profiles[player]
Sorry for the late reply. I've been very busy. Hopefully you've already found an answer elsewhere by now. If not: ProfileService at its very, very, very watered down basics is Roblox's normal DataStores glorifed, so I'm going to assume it's the same as that: just use the exact same code in the other place below the game, making it load with the exact same data key and everything. I might be wrong because I'm not super familiar with ProfileService. I only use its basics to cleanly and efficiently save data in my projects, and I've never experimented with it myself. Please let me know if it works!
Im having some problems with the code. it works and the leaderstats loads but it seems that the data isnt saving. Ive checked the code many times and i have HTTP and API on anyone help?
@@AmoraScripting in the dev console with F9 would you just edit the values like you normally would and profile service would save them? or is there something else you need to type in there for profile service to save it because i dont think it let me edit stats in the dev console to where it saved when i rejoined. lol i meant dev console not log
hey im really confused on how to use tables in the template section and how to add things to it so it is stored if you can help me that would be great, i have an example of what im trying to do if you dont really understand what im saying. Thank you for the great video!
@@hehe-vk4ls Inside of the template module, all you need to do is create a table like normal. An example: "MyTable = {}" That data is still accessed the same way as every other value in the player's data: by accessing their data through the DataManager. Editing the table and reading the table is exactly the same as tables inside of variables in other scripts. You use table.insert to add values, table.remove to remove values, and table.find or player.Data.MyTable[value] to read values. Because this is player data, the values in the table must be equal to a number, boolean, string, or another table. The values in the table must not be equal to objects. Otherwise, it will break the data stores. I hope this helps :)
@@AmoraScripting when the player connects im trying to use a characteradded event under the playeradded event but any script inside characteradded doesnt work, any fix?
It doesn't work and the error says instance expected got table in the line 3 of leaderstats :( it's been 6 days since I'm trying to create a datastore and this was my last chance
@@AmoraScripting it worked i wrote .Create instead of :Create... You're an awesome scripter, recognized the error just by a yt comment, deserves a sub
I'm aware. I put it into a separate module because that's how I like to organize it. It feels easier to read to me, and that's how it was made in the video. You can change it accordingly yourself if you do not wish to have it in its own module.
amazing script and stuff but i type 150 wpm in c++ and i couldnt keep up without having to pause every 10 seconds It's extremely annoying, if your gonna explain then slow down a little please.
I get it. My brain just likes to go fast. When I start making videos again, I will slow down more. I can type unreasonably fast in the perfect conditions. My fastest typing speed ever was 193 wpm Thank you for the feedback!
That might be something you'll have to do some research on, unfortunately. I don't have much knowledge on cross-game data saving. Especially with ProfileService.
@@joeldct You can, if the game is made inside of the game (in the asset manager) all you gotta do is copy the data store stuff over and the data will pass over
I'm trying to figure out how I would make the gamepass basically save the player's data just so i can check if a player owns it but in an easy way for me here is a script i tried (NOTE: It's just for testing too see if it prints like if it works) local serverScriptService = game:GetService("ServerScriptService") local dataManager = require(serverScriptService:WaitForChild("ServerModules"):WaitForChild("DataManager")) game.Players.PlayerAdded:Connect(function(player) local profile = dataManager.Profiles[player] if not profile then return end
This is the worst way possible to check if someone owns a game pass. Use MarketplaceService:UserOwnsGamePassAsync() create.roblox.com/docs/reference/engine/classes/MarketplaceService
the model you left in description are different from what you shown, I dont kinda want to write all by myself cuz I already watched the video@@AmoraScripting oh nvm I was just watching video at 4 am and wanted to sleep so uh xd
@fuducklol Create values inside of the player, inside a leaderstats folder or not, then you can change the value to the data when the data changes and use that value for a text label
I need some help, Basically I did everything and when I run it the leaderstats doesn't show up. Can you tell me the problem. I also looked through every line of codes in the Module Scripts.
@AmoraFolf Leaderstats: local module = {} function module:Create(player: Player, profile) local leaderstats = Instance.new("Folder") leaderstats . Name = "Leaderstats" leaderstats . Parent = player
local cash = Instance.new("IntValue") cash . Name = "Cash" cash . Value = profile . Data . cash cash . Parent = leaderstats end return module (I can't put the dots in without spaces because suspicious link)
@@TheCoolestGuyEverLol I know, but this is how I prefer to organize it. Change it to however you like. It will work no matter what if it's set up correctly.
Also, why did you use a module script instead of a regular script if you're not gonna use a module script to re-use code. You literally used a module script like a normal script except you need to require it for it to run ;-;
@@AmoraScripting What i am doing is making a script named "currencyData" and making a profileStore with the key and the currency template inside the template's module (Templates.Currency). And then, when i check if the player is descendant of, let's say there are two tables inside the datamanager. I'm making it the currencyProfiles table. And then making another script but with the inventoryProfiles table in the same datamanager module. Is there any problem with it?
@@AmoraScripting Nvm you can forget what i said, i just don't want to Store all the player stats inside the same key. I figured out there is no problem with it, but i wanna find a way to manually change the datastore when in-game as an Admin. How can I relate the saved data with the new data so I can change the Player's (e.g. Coins) value? If I do it, the data is attached to the saved data so i can't change it. Everytime it updates it comes back, so i tried to find a way to change the saved data instead but I couldn't find it.
@Washavalaca There are ways to do it, like if you wanted an inventory system, you could save the name of the object in the inventory and the amount of it, and then load the object by duplicating it into the inventory, but you cannot actually save objects themselves in datastores. ProfileService, at the end of the day, still uses Roblox's default datastores, but it creates features to make it incredibly secure and way better.
I am trying to do this: A player spawns with a wooden sword then if they defeat a boss they get stone sword. So I need a way for tools to save when the player dies or leaves and I need it to save for new tools. So I tried different scripts but none of them worked. How can I use profile service to do this?
You can add a table to the template full of every tool's name, then when they get a new sword, use "table.insert(profile.Data.WhateverYourTableNameIs, tool.Name)" to save the new tool. Or, instead of tool.Name, you could just insert the string directly, but I recommend using tool.Name. After you publish the game and people get save data, it's important not to change the name of the tool. Otherwise, if you're cloning all of their saved tools into their backpack, or if you're cloning one based on an equipped tool value in their data, it will error because it can't find the tool with the same name.
I don't like to let you copy the code because then you can't learn from it. However, the official documentation on ProfileService will have basic level code on how to use it.
the leaderstats doesnt show up for me this is the script local module = {} function module:create(player: player, profile) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player
If you're talking about places that are part of a parent game, then yes. However, it will not work across completely different games, at least to my knowledge.
@@AmoraScripting thanks! im also working on a parkour game, although im way much more of a builder/visual design/concept art whatever. So most i can do is change properties when it comes to scripting lol.
If you have any issues, let me know! I'll help to my best ability!
I have a problem, so basically i use coins and when the player picks up the coin it gives an error :
Data is not valid member of Player
So basically how do i get the data folder?
@@555peti_ you are trying to set data in the player. Change the line to "profile.Data.Coins" instead.
When more players join the game then my data crashes
I have another problem man, when a player rejoins the game the data does not load in
@@555peti_ if you added .Mock at the end of .GetProfileAsync, it won't load or save any data
great tutorial, but i really want to point out how much I appreciate the entire part starting at 11:32 I'm very new to doing this, but having an explanation on what each line does is incredibly helpful to grasping this entire concept.
If your Table values aren't saving, it's probably because your table has mixed integer and string indexs, read the top of ProfileService. I hope this helps anyone so they don't bang their head into the wall for 3 days like i just did
why dont you have more subs lol!
imma sub cuz this is genuinely helpful!
i'll tell you why he is a furry
@@opm_a-ngo2903 damn bruh💀💀I just liked the tutorial lol
@@AA_idkhaha he still furry tho
@@opm_a-ngo2903 boohoo. Who cares. If you don't like that, then leave
This just makes my life much easier
Amazing tutorial but I would recommend slowing down some i had to watch this in .6x speed lol
tysm this help alot it really allow me to understand
It worked in my test game, but when I tried it on my actual game it just didn't save, and I lost all my previous data from my old datastore.
so im trying to make it so that when you use a tool (which is in your starterpack) and you click you get 1 sip, the problem is the sip value isnt going up ive used both local and regular scrips im not sure whether or not im needing to use remote events?, heres my code
local serverScriptService = game:GetService("ServerScriptService")
local DataManager = require(serverScriptService:WaitForChild("Modules"):WaitForChild("DataManager"))
script.Parent.Activated:Connect(function(player)
local profile = DataManager.Profiles[player]
if not profile then return end
profile.Data.Sips += 1
player.leaderstats.Sips.Value = profile.Data.Sips
end)
Update, if youre using tools to gain points with a local script, use remote events
why tool, just make a simple button (well, first understand how to do it through button, then do tool)
@@SadlekAski that did not help them at all.
Hi, I see you are quite good at this and I need some advice. I can also use this script to automatically save the time spent on the server, I've been struggling with this for a long time, but no script ever works for me. It always shows me a problem in the datastore and I don't know what to do about it. Does saving also work for more things, for example saving time and also saving money in the game? thank you very much
Thanks! How can I save data in multiple locations?
You're a GOD bro, thank you so much!
Great tutorila but i have a issue here is my error : ServerScriptService.Module.ProfileService:1714: [ProfileService]: Profile template not set - ProfileStore:LoadProfileAsync() locked for this ProfileStore
Nice video it was very helpful! Btw do you know how to access every profile created in the store (to make a global leaderboard)?
Unfortunately, that is one of the things with profile service I don't know how to do. You'll have to do some research on that.
@@AmoraScripting hey ik its a year later and stuff but how would i save one value that's in the leaderstats folder and then have more values that aren't leaderstats?
edit: used common sense and figured it out myself thx for the tutorial
im trrying to make a obby but with saving obby progression would this work for me with the obby or would i be better off writing a regular leaderstats script for it becuase when i join and re load it doesnt save? (I got it to save!)
I dont know what the fuck is going on in this video but hey, it saves data.
what if i want to like make a inventory system so it saves the players pets
hello why i cant acces profiles[player], and when i console log profiles, its dont have nicknames or something like that
Can you make a addon video of this where you can pick between multiple slots to access your data?
if i want to change the datastore to a different save, how do i do it?
I followed the scripting - but it doesn't have any leaderboard? All it shows is my name
Thanks in advance
hey, nice tutorial!
i was wondering if it would be worse if i made a maybe "statsHandler", and make functions like
"player.profile.Data.Exp.Changed:Connect(function())"
to make it so when the player gets exp, i dont need to update it inside the own script, would that work?
those waitforchilds are... oof, that's a lot of em, if you want to just load them via dot/bracket indexing, you can do game.Loaded to wait until everything is loaded.
Yeah.. it's a force of habit for me. Most of them aren't even necessary! I don't know why it's just a force of habit 🤣
@@AmoraScripting well, it prevents those annoying "attempt to index string with nil" errors lol
@@verticalpug2026 You got that right, lmfao
i get an error saying argument 3 missing or nil. can you please help?
leaderstats doesn’t show up in the leaderboard when I’m in game and doesn’t show up in my player when I check in studio
I have tried rewritting the leaderstats scripts a few times already
I got leaderstats to work but it doesn’t save there’s no errors
Might be because it’s not loading the data
Thanks but, how do I make it work with a remote event whenever the remote event fires it loads a data value that it added. But if the player joins the data doesn't load for some reason.
I'm getting the ProfileService Missing or invalid Name paramater bug
im having troubles with my leaderstats is there any chance you could help?
this message is outputed when i run the game" 12:36:29.253 ServerScriptService.Modules.ProfileService:1409: attempt to index nil with 'Data'"
Whats the point of using a proximity prompt? Can I do it without it?
It was a demonstration.
@@AmoraScripting what do you mean by that
@@AmoraScripting im just trying to store 2 variables ive created in a local script on the server so that when someone leaves and rejoins i can access their user specific variable values and display them
@@superstitic I mean that the proximity prompt is just an example of how to change the data in ProfileService.
If your having an issue with the Data Manager at line 19, its AddUserId not AddUserID. I struggled with this small error for hours.
Very small typos are very much a burden and very hard to notice.
@@AmoraScripting They are, Now the leaderstats are showing and updating but its not saving the information har har
@@EeveeTheQueen Do you receive any errors in your output? It's likely something else wrong in your DataManager.
@@AmoraScripting No other errors. Im attempting to add a timer instead of a proximity prompt so maybe my error is there.
@@EeveeTheQueen Well, if your leaderstats are going up, you're either not changing the data itself, or there's something wrong with your DataManager.
yo on the part stuff where when u fire the prox prompt why do I ge tan error attempt to index nil with instance Im erroring on this line local profile = dataManager.Profiles[player]
how would i access this data inside of a "place" under the main game?
Sorry for the late reply. I've been very busy. Hopefully you've already found an answer elsewhere by now. If not:
ProfileService at its very, very, very watered down basics is Roblox's normal DataStores glorifed, so I'm going to assume it's the same as that: just use the exact same code in the other place below the game, making it load with the exact same data key and everything.
I might be wrong because I'm not super familiar with ProfileService. I only use its basics to cleanly and efficiently save data in my projects, and I've never experimented with it myself. Please let me know if it works!
@@AmoraScripting thanks for the response, i never actually did find out so this information is very useful, thanks!
Im having some problems with the code. it works and the leaderstats loads but it seems that the data isnt saving. Ive checked the code many times and i have HTTP and API on anyone help?
in the log you can edit your leaderstats and scripts easily, how would you edit your stats yourself with profileservice
Can you expound? I'm a bit confused with what you're saying.
@@AmoraScripting in the dev console with F9 would you just edit the values like you normally would and profile service would save them? or is there something else you need to type in there for profile service to save it because i dont think it let me edit stats in the dev console to where it saved when i rejoined. lol i meant dev console not log
What is the purpose of script PlayerData in ServerScriptService?
is this video still up to date? just curious if my current issue is a spelling error or not
Nothing is outdated.
Is this safe to do in a script that's in the workspace? Shouldn't the data be handled in a server event?
It is perfectly safe.
hey im really confused on how to use tables in the template section and how to add things to it so it is stored if you can help me that would be great, i have an example of what im trying to do if you dont really understand what im saying. Thank you for the great video!
@@hehe-vk4ls Inside of the template module, all you need to do is create a table like normal. An example: "MyTable = {}"
That data is still accessed the same way as every other value in the player's data: by accessing their data through the DataManager. Editing the table and reading the table is exactly the same as tables inside of variables in other scripts. You use table.insert to add values, table.remove to remove values, and table.find or player.Data.MyTable[value] to read values.
Because this is player data, the values in the table must be equal to a number, boolean, string, or another table. The values in the table must not be equal to objects. Otherwise, it will break the data stores.
I hope this helps :)
@@AmoraScripting thanks, this helped a lot!
@@AmoraScripting when the player connects im trying to use a characteradded event under the playeradded event but any script inside characteradded doesnt work, any fix?
@@hehe-vk4ls Is the CharacterAdded event right at the very top of PlayerAdded? Sometimes, it refuses to work if it's not at the top in my experience.
@@AmoraScripting yeah it is but it wont load anything, i tried making a seperate event in a normal server script and it didnt work there either
what do I do if i'm getting this error message: ServerScriptService.Modules.ProfileService:2209: [ProfileService]: Missing or invalid "Name" parameter
Nice tutorial.
It doesn't work and the error says instance expected got table in the line 3 of leaderstats :( it's been 6 days since I'm trying to create a datastore and this was my last chance
Please show me line 29, and only line 29 of your DataManager module.
@@AmoraScripting i will be home in 30 min, btw i appreciate a lot the fact that you actually answered, you're a life saver fr fr
@@AmoraScripting it worked i wrote .Create instead of :Create... You're an awesome scripter, recognized the error just by a yt comment, deserves a sub
@@AnytimeUseless I'm glad you were able to figure it out! I hope your project goes well!
@@AmoraScripting tysm, with your help it will go well 100%
I do not believe leaderstats has to be an entire module. You can make all of it in a normal serverscript
I'm aware. I put it into a separate module because that's how I like to organize it. It feels easier to read to me, and that's how it was made in the video. You can change it accordingly yourself if you do not wish to have it in its own module.
would this break my in-game leaderboards?
No. You just need to make sure it's set up properly.
@@AmoraScripting what do you mean?
amazing script and stuff but i type 150 wpm in c++ and i couldnt keep up without having to pause every 10 seconds
It's extremely annoying, if your gonna explain then slow down a little please.
I get it. My brain just likes to go fast. When I start making videos again, I will slow down more. I can type unreasonably fast in the perfect conditions. My fastest typing speed ever was 193 wpm
Thank you for the feedback!
@@AmoraScripting Yeah of course. I spoke a little too early because I'm getting server kick message even after I did everything perfect,
are u dumb? just slow the video down
How do you update bool value with this ?
I tryed the old ones and says many errors
hey! can profile service be used between games?
That might be something you'll have to do some research on, unfortunately. I don't have much knowledge on cross-game data saving. Especially with ProfileService.
you can't use them across games lol. You can only link stuff to badges and give them items in the other game if they own the badge
@@joeldct You can, if the game is made inside of the game (in the asset manager) all you gotta do is copy the data store stuff over and the data will pass over
@@not_sambreto thats not what he meant. He means 2 different games
@@joeldct oh ok, unless it was like a sequel to the game there wouldn’t be a point but thanks
I'm trying to figure out how I would make the gamepass basically save the player's data just so i can check if a player owns it but in an easy way for me here is a script i tried (NOTE: It's just for testing too see if it prints like if it works)
local serverScriptService = game:GetService("ServerScriptService")
local dataManager = require(serverScriptService:WaitForChild("ServerModules"):WaitForChild("DataManager"))
game.Players.PlayerAdded:Connect(function(player)
local profile = dataManager.Profiles[player]
if not profile then return end
wait(2)
profile.Data.VIP_Gamepass = true
task.wait(0.1)
print(profile.Data.VIP_Gamepass)
end)
This is the worst way possible to check if someone owns a game pass.
Use MarketplaceService:UserOwnsGamePassAsync()
create.roblox.com/docs/reference/engine/classes/MarketplaceService
the model you left in description are different from what you shown, I dont kinda want to write all by myself cuz I already watched the video@@AmoraScripting
oh nvm I was just watching video at 4 am and wanted to sleep so uh xd
How do I get it in a local script, because it doesnt see modules
Don't.
@@AmoraScripting oh
@@AmoraScripting well do you have and advice on how you would put these on a text label
@fuducklol Create values inside of the player, inside a leaderstats folder or not, then you can change the value to the data when the data changes and use that value for a text label
@@AmoraScripting this is my 3rd time reading it i finally understand it
I need some help, Basically I did everything and when I run it the leaderstats doesn't show up. Can you tell me the problem. I also looked through every line of codes in the Module Scripts.
Can you show me your script?
@@AmoraScripting
Template:
local template = {
Cash = 0,
}
return template
@@monkeechunke96 show me the datamanager module and leaderstats module as well, please
@AmoraFolf
Leaderstats:
local module = {}
function module:Create(player: Player, profile)
local leaderstats = Instance.new("Folder")
leaderstats . Name = "Leaderstats"
leaderstats . Parent = player
local cash = Instance.new("IntValue")
cash . Name = "Cash"
cash . Value = profile . Data . cash
cash . Parent = leaderstats
end
return module
(I can't put the dots in without spaces because suspicious link)
@@monkeechunke96 you capitalize the name of the leaderstats folder. It has to be all lowercase, or it won't work.
hi, how could i acces the data thru the client?
You can't. You also never should. That is a stupid idea because it is so incredibly exploitable.
And how do I restart the data?
if i had a table in template named Inventory how to add things to the table?
You would use "table.insert(profile.Data.TableName, value)"
@@AmoraScripting Thank you, I've been struggling with this all day to make it happen, but you solved it.
@@gerixycs glad I could help! 😁
You couldve done the exact same thing by just using 1 module like i do
@@TheCoolestGuyEverLol I know, but this is how I prefer to organize it. Change it to however you like. It will work no matter what if it's set up correctly.
Why do you use waitforchild on the server ;-;
@@anotherdeadchannel I have waitforchilditis.
Also, why did you use a module script instead of a regular script if you're not gonna use a module script to re-use code. You literally used a module script like a normal script except you need to require it for it to run ;-;
@@anotherdeadchannel organization.
@@AmoraScripting Understandable, have a nice day.
what do i do if i want to change it from cash to like levels
Change it in the template and the name of the leaderstats (if there are any)
thanks and also my leader board doesnt work at all@@AmoraScripting
got it working missing capital lmao@@AmoraScripting
I dont have this CashPart in studio
Thank you brother☝
Can you make a .GetProfileStore method with different keys and templates for something like currency and inventory?
Yes, you can. The ones in my tutorial were examples.
Can you artificially change the profile's value in-game?
@@AmoraScripting What i am doing is making a script named "currencyData" and making a profileStore with the key and the currency template inside the template's module (Templates.Currency). And then, when i check if the player is descendant of, let's say there are two tables inside the datamanager. I'm making it the currencyProfiles table. And then making another script but with the inventoryProfiles table in the same datamanager module. Is there any problem with it?
@@noturne54 I'm a little confused on what you're trying to do. Can you clarify a bit for me, please?
@@AmoraScripting Nvm you can forget what i said, i just don't want to Store all the player stats inside the same key. I figured out there is no problem with it, but i wanna find a way to manually change the datastore when in-game as an Admin. How can I relate the saved data with the new data so I can change the Player's (e.g. Coins) value? If I do it, the data is attached to the saved data so i can't change it. Everytime it updates it comes back, so i tried to find a way to change the saved data instead but I couldn't find it.
do you know how I can wipe data?
@@unifow For a specific player or every single player?
@@AmoraScripting every single player
@@unifow Change the data key.
@@AmoraScripting ooooh I just tried it and it works. Tysm.
thanks man
Believe it or not they are a girl, at least that's what they claim
How do I store objects?
@@Washavalaca You can't
@@AmoraScripting but in numbers, if hair = 12 then it will create a part and so on
@Washavalaca There are ways to do it, like if you wanted an inventory system, you could save the name of the object in the inventory and the amount of it, and then load the object by duplicating it into the inventory, but you cannot actually save objects themselves in datastores. ProfileService, at the end of the day, still uses Roblox's default datastores, but it creates features to make it incredibly secure and way better.
how to add boolValue??
You add the value in the template and set it to true or false.
I am trying to do this:
A player spawns with a wooden sword then if they defeat a boss they get stone sword.
So I need a way for tools to save when the player dies or leaves and I need it to save for new tools. So I tried different scripts but none of them worked. How can I use profile service to do this?
You can add a table to the template full of every tool's name, then when they get a new sword, use "table.insert(profile.Data.WhateverYourTableNameIs, tool.Name)" to save the new tool.
Or, instead of tool.Name, you could just insert the string directly, but I recommend using tool.Name. After you publish the game and people get save data, it's important not to change the name of the tool. Otherwise, if you're cloning all of their saved tools into their backpack, or if you're cloning one based on an equipped tool value in their data, it will error because it can't find the tool with the same name.
i hope u get 10k sub for this but can you provide the scripts because that would really help me out
I will never give the scripts out. You do not learn from copying and pasting. The purpose of my channel is to teach.
I like your pfp
Aww, thank you! :)
Tysm
Could you please post the code from the video somewhere so that it can be copied
I don't like to let you copy the code because then you can't learn from it. However, the official documentation on ProfileService will have basic level code on how to use it.
Finally a furry roblox dev, if I learned anything always trust furries with tech.
😂😂
what
Uhh I need help haha
What do you need help with?
hkmn
the leaderstats doesnt show up for me
this is the script
local module = {}
function module:create(player: player, profile)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local money = Instance.new("IntValue")
money.Name = "Money"
money.Value = profile.data.money
money.Parent = leaderstats
local food = Instance.new("IntValue")
food.Name = "Food"
food.Value = profile.data.food
food.Parent = leaderstats
end
return module
I have two questions. Are you getting any errors? And are you running the function in the DataManager script?
player: Player*
Does this save between places? if not would u know how i can possibly save the data between different places
If you're talking about places that are part of a parent game, then yes. However, it will not work across completely different games, at least to my knowledge.
@@AmoraScripting thanks! im also working on a parkour game, although im way much more of a builder/visual design/concept art whatever. So most i can do is change properties when it comes to scripting lol.