Getting started with a new framework can feel a bit like trying to assemble furniture without the manual. You know all the pieces are there, but figuring out which bolt goes into which hole is a nightmare. Flamework is a bit different because it's built to be opinionated—in a good way. It tells you where things should go so you don't have to guess.
What is Flamework anyway?
Before we dive into the commands and folders, let's talk about why you'd even want to bother. Most Roblox developers are used to the standard "Scripts" and "LocalScripts" model. That's fine for a small obby, but the moment you start building a full-scale RPG or a complex simulator, those scripts start tangling like a pair of headphones in your pocket.
Flamework is a "macro-based" framework for roblox-ts. It uses something called decorators—those little @ symbols you might have seen in other languages—to handle things like dependency injection and lifecycle events automatically. It basically takes the heavy lifting out of organizing your game logic. You create a class, slap a decorator on it, and Flamework ensures it runs exactly when it's supposed to.
Getting your tools ready
You can't just write Flamework code in the Roblox Studio script editor. It won't work. Since Flamework is built for TypeScript, you need a proper environment.
First, make sure you have Node.js installed on your computer. If you don't, head over to their site and grab the LTS version. You'll also need Visual Studio Code (VS Code), which is the industry standard for this kind of work. Once those are ready, you'll want to install the roblox-ts package globally. You can do this by opening your terminal and typing npm i -g roblox-ts.
Don't forget Rojo. Rojo is the bridge that syncs your code from VS Code into Roblox Studio. Without it, your TypeScript files are just text sitting on your hard drive doing nothing.
The actual installation process
Now for the meat of the flamework roblox framework setup guide. Start by creating a new folder for your project. Open your terminal in that folder and run rbxts-init. You'll get a few prompts; I usually go with the "model" or "game" template depending on what I'm making.
Once your base roblox-ts project is ready, you need to pull in Flamework. Run these two commands:
npm i @flamework/core @flamework/networkingnpm i -D rbxts-transformer-flamework
The first command installs the actual logic parts of the framework. The second one is a "transformer." Because Flamework does some fancy magic behind the scenes during the compilation from TypeScript to Lua, it needs this transformer to understand your decorators.
Configuring the compiler
This is the part where most people get stuck. You have to tell your TypeScript compiler to actually use the Flamework transformer. Open your tsconfig.json file in the root of your project. You'll need to add a section under compilerOptions called plugins.
It should look something like this:
json "plugins": [ { "transform": "rbxts-transformer-flamework" } ]
Without this, Flamework is just a bunch of dead code. The transformer is what turns your @Service tags into actual functioning Roblox logic. If you start your game and nothing happens, 90% of the time it's because this little snippet is missing from your config.
Organizing your project files
Flamework likes things organized. Inside your src folder, you'll usually want to have three main subfolders: client, server, and shared.
- Server: This is where your Services live. Think of a Service as a singleton that handles specific logic, like a "DataService" for saving player stats or a "RoundService" for managing game timers.
- Client: This is where your Controllers live. Controllers are the client-side version of Services. They handle UI, input, and local visual effects.
- Shared: This is for code that both the client and server need to see, like configuration files or networking definitions.
One of the coolest things about this setup is that the server and client can talk to each other through the shared folder using Flamework's networking package, which makes remote events feel almost like calling a regular function.
Writing your first Flamework service
Let's actually write something so you can see it in action. In your src/server/services folder, create a file called MyService.ts.
```typescript import { Service, OnStart, OnInit } from "@flamework/core";
@Service({}) export class MyService implements OnStart, OnInit { onInit() { print("My service is initializing"); }
onStart() { print("My service has started!"); } } ```
That's it. You don't have to manually require() this script or put it in a specific folder in Roblox Studio. As long as it's decorated with @Service, Flamework will find it and run it. The onInit method runs before the game fully starts (useful for setting up variables), and onStart runs once everything is ready to go.
Why this framework changes the game
You might be thinking, "This seems like a lot of work just to print a message." And you're right—for a "Hello World" script, it's overkill. But imagine you have fifty different systems in your game.
In a traditional Roblox setup, you'd be worrying about which script runs first, how to pass data between them, and whether or not a RemoteEvent has been created yet. Flamework handles all of that. It manages the load order and allows you to "inject" one service into another. If your CombatService needs to check something in the LevelingService, you just ask Flamework to give it to you, and it works. No more _G or messy global variables.
Fixing common setup hiccups
If you've followed this flamework roblox framework setup guide and things still aren't working, don't panic. Here are a few things to check:
- Check your Rojo sync: Make sure Rojo is actually running and connected to Roblox Studio. If the "scripts" folder in Studio is empty, your code isn't being compiled or synced.
- Check the Output window: Roblox Studio's output window is your best friend. Look for errors that say "Flamework was not initialized." This usually means your entry point (the
index.server.tsorindex.client.tsfile) isn't callingFlamework.addPaths()andFlamework.ignite(). - NPM issues: Sometimes a quick
npm installcan fix weird issues where packages didn't download correctly.
Getting a flamework roblox framework setup guide to work perfectly on the first try takes a little patience, but once you get that first "Service started" message in your console, you'll never want to go back to standard Lua scripting. It's like graduating from a bicycle to a turbocharged car; there's a bit of a learning curve, but you'll get where you're going a lot faster.
Remember that the community around roblox-ts and Flamework is actually pretty great. If you get truly stuck, the Discord servers for these tools are full of people who have run into the exact same issues. Don't be afraid to experiment with the structure. While Flamework is opinionated, it's also flexible enough to let you build the game the way you want to. Happy coding!