Hi, so i am making a project where i’ll make achievements. My idea was to make a saving dataStore but with BoolValues for each achievement, but i don’t know if that would work, can anybody answer me that, if you’ve ever done it?
Also if it’s not possible can anyone give me recommendations of how i can make it please? I am accepting any ideas of how i can make it.
That would NOT be a great idea cause getting a lot of data from different boolvalues from the data store sends a lot of requests there, and also there are data store limits, and you can only send 10 every minute to every player
Maybe try making an integer value where you have to change a digit to show the player got the achievement.
000000
Player got achivent => 100000
As you can see, it’s a better way to save, and will take up less data store space.
Yes i was thinking about that as a second option but how would i do that? Cause i’d have a lot of achievements how would i know the specific one the player already got?
Ok I will look up a script to change a character in a string
Sorry, I could only find how to do it for a string, so store the accomplishment data in a string,
function replace_char(pos, str, r)
return str:sub(pos, pos - 1) .. r .. str:sub(pos + 1, str:len())
end
— use it like local tar= replace_char(5, 00000, 1)
— tar would be 00001
I recommend you put it somewhere in a module script, these may seem like a new thing, but trust me they are not too hard to use. Insert this script into the module, I recommend you put the module into workspace
local module{}
function module.ChangeStr(pos, str, r)
return str:sub(pos, pos - 1) .. r .. str:sub(pos + 1, str:len())
end
return module;
Then you can call it from a normal script like this
local f=require(location of Module Script CHANGE THIS)
local y=f.ChangeStr(the place of the char in the string, where you would want the string data., the number you wanna change it to)
print(y);