How do I create achievements in a game?

I wanna make like achievements like if you have a new achievement you will unlock it. please help me

if(something_happens){
project.name_of_achievment = true;
//If an achievement is unlocked, 
//a variable for it is set to true 
//to tell the project it was unlocked
}
if(project.name_of_achievment){
something_happens;
// If the variable shows that
// the achievement is unlocked,
// allow something to happen

// Note: you can refer to this anywhere in your project
}
1 Like

these are basic javascript conditions.
you may find useful to check:

achievement code1-11-2021_14-01-40.wick (10.4 KB)

Does this help?

What it does is that, when you press the lockpad (i think it was named that way),it checks if project.codeunlocked === true, if it is, then it opens the door.

And when you press the button to get the code, it makes project.codeunlocked be true.

If you press the lockpad while project.codeunlocked is false, a message will appear, but the door will not open.
I guess that’s all.

(Also sorry if my english is bad, it’s not my first language…)