A script can add advancements of its own to the game's advancement screen, and hand them out:
advancement "first kill":
title: "&cFirst blood"
description: "Win a fight against another player"
icon: iron sword
frame: challenge
on player kill:
grant advancement "first kill" to player
Written
Meaning
advancement "<name>":
At the left margin. The name is what it is granted by
title: / description:
What players read. Without a title, the name is shown
icon: <item>
The item drawn in its frame; a book unless said otherwise
frame: task, goal or challenge
The shape of the frame, and how grandly it is announced
parent: "<name>"
The advancement it hangs under in the screen. Without one it hangs under the server's own first entry
announce: false
Do not tell everybody in chat
hidden: true
Out of sight until somebody has it
grant advancement <name> to <who>
Give it. The pop-up, the sound and the line in chat are the game's own
revoke advancement <name> from <who>
Take it back
<who> has advancement <name>
A condition; does not have advancement likewise
Nothing in the game can earn these: only grant advancement does. That makes them a way of remembering as well; player has advancement "first kill" is saved by the game itself.
All of a server's own advancements share one tab in the advancement screen.
They are added when the scripts load. A player's progress is kept by the game and survives restarts; an advancement that is taken out of its script is gone from the screen.