Games Quest Systems Luau Source & Structure Checked (Roblox Luau)

Roblox Luau Quest & Objective Tracker

Typed Roblox Luau ModuleScript service for tracking per-player quest states, incrementing objective counters, and emitting completion rewards cleanly on the server.

ID: games/roblox-quest-tracker Version: 1.0.0 License: MIT Framework: Roblox Studio

Architecture & Runtime Preview

Roblox Studio

Roblox Luau server module — store QuestConfig in ReplicatedStorage/Quests/QuestConfig and QuestService in ServerScriptService/Quests/QuestService.

  1. 1ReplicatedStorage/Quests/QuestConfig.luau (frozen quest + objective definitions)
  2. 2ServerScriptService/Quests/QuestService.luau requires QuestConfig via ReplicatedStorage:WaitForChild("Quests"):WaitForChild("QuestConfig")
  3. 3QuestService.AcceptQuest(userId, questId) & RecordProgress(userId, objectiveType, delta, onCompleted)
Example Project Integration: Place QuestConfig.luau as a ModuleScript at ReplicatedStorage/Quests/QuestConfig and QuestService.luau as a ModuleScript at ServerScriptService/Quests/QuestService.

Source Code (2 files)

QuestConfig.luau · luau
--!strict
export type QuestReward = {
	xp: number,
	gold: number,
}

export type QuestDefinition = {
	id: string,
	title: string,
	objectiveType: string,
	targetCount: number,
	reward: QuestReward,
}

local Quests: { [string]: QuestDefinition } = {
	slime_hunt = {
		id = "slime_hunt",
		title = "Clear the Meadow",
		objectiveType = "defeat_slime",
		targetCount = 5,
		reward = { xp = 120, gold = 50 },
	},
	herb_gather = {
		id = "herb_gather",
		title = "Alchemist's Request",
		objectiveType = "collect_herb",
		targetCount = 3,
		reward = { xp = 80, gold = 35 },
	},
}

return table.freeze(Quests)

Installation & Usage

Create a Folder named Quests in ReplicatedStorage with ModuleScript QuestConfig (QuestConfig.luau), and a Folder named Quests in ServerScriptService with ModuleScript QuestService (QuestService.luau).

Require ServerScriptService.Quests.QuestService on the server, call QuestService.AcceptQuest(player.UserId, "slime_hunt"), and report progress via QuestService.RecordProgress(player.UserId, "defeat_slime", 1, onCompleted).