I need someone to answer me a question

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.

Thanks :smile:

1 Like

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.

1 Like

Alright, do you have any ideas of how i can make it then?

1 Like

Save achievements every 10 minutes and when player leaves with pcall()?

If the achievement value is already true dont save it

1 Like

Could that be a bit more specific? I’m not entirely sure of how i can do that tho.

1 Like

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?

1 Like

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);
2 Likes

This post is a good example of saving data upon a leaving player.


Use this to prevent saving already achieved achievements.

	if not achievement.Value then
		saveData()
	end

Thats only an example.

2 Likes

Looking at that it looks harder than anything i’ve ever done not gonna lie i never used module scripts a single time

1 Like

Well they are not to hard, you can make functions in a module script which you will be able to run in ANY script, so they are sorta useful.

1 Like