How would I script unlockable abilities?

To make it short and simple, I’m unsure how to do this and how to start it.

I basically have a couple of weapons, each weapon will have their own unique abilities. However, those abilities can only be unlocked one by one throughout progression (via levelling up or buying).

The reason I’m confused as to what to do is because I’m unsure how to set it up. Do I clone a script and place it into the character? Do I check their level and then set a value to true?

How can I go about this?

Assuming you want it to be persistent between sessions, it will need to use DataStores and should thus be a server script. I think the DataStores page on the wiki has an example of this you could start with.

DataStores is something I would definitely use for this.

However, I’m looking more for:

  • You start off with a sword.

  • You talk to an NPC with enough money.

  • The NPC teaches you skills.

I’m just unsure as to how to go about the NPC giving you the skills.