Hi, i’m making a game where i need to make achievements, but i don’t know how i can make it, my previous idea was to use boolvalues but that didn’t work out.
Can someone please help me? I really need a way to save achievements when a player leaves the server, i’m open for questions and more information, thanks
The best approach would be to use a dictionary with key as the achievement name and the value being a boolean to represent if they have earned the achievement.
ie.
local achievements = {
["Joined the game!"] = true;
};
--// Adding a new earned achievement
achievements["Owns 100 coins!"] = true;
--// Checking if they own an achievementnil is falsey and is returned if it's not in the dictionary
if (achievements["Gaming"]) then
print("Gaming"); --// Won't print since they don't have it
end
achievements can be saved/retrieved from the DataStore like any other data. Additionally, can be sent across Bindables/Remotes (no need for BoolValues).