How would I go about scripting a quest system

So I am trying to make a npc give a player a quest and if that quest is completed it gives a new quest and rewards a player. I want to add a frame that shows the questname and reward to a scrollingframe which has all the quests listed so I add it there. So I have no clue how I should make it save the quest and the progress. I tried scripting one but it was really messy and I ended up deleting that code. Please help I am confused.

So you want to make a quest system that saves a players progress even when they leave? or just in game?

  1. I would first create/program all the quests a player can complete
  2. If you are trying to make it save the players progress within the quest, you would have to use DatastoreService (DataStoreService, How to Store Multiple Values with Data Store - Roblox Studio Tutorial - YouTube)

I am still a little bit confused on what you are trying to achieve could you please clarifiy?

So you want to make a npc quest system, when a player completes one quest another is given and the player is rewarded. And you also want the quest progress to save even if the player is not in game correct?

Yeah it is exactly what I wanted the quest system to do.

You should invest your time into datastores. They can get really complicated if you want them to save 100% of the time and not fail, but the learning curve is definitely worth it as they allow you to save stuff after the player quits the session.

here are some helpful resources.
https://developer.roblox.com/en-us/articles/Data-store
https://devforum.roblox.com/t/stop-using-setasync-to-save-player-data/276457

and finally, here is my personal favorite article. This one has saved me MANY times, and is extremely useful.

Thanks!

I have a question though how would I give a quest to a player and make it keep checking if the player has done a task? for example the player owns a sword or tool.

I think if I find out this then I am all set to make my own quest system!