FastFlag is a modern open-source Roblox Luau module that brings FastFlags to Roblox. It allows you to make changes to any implemented state inside of live production code without publishing any changes. When you change FastFlag’s value, it will immediately update the given FastFlag in every running server and will persist indefinitely.
Whether system that relies on real world forecast data, updated in real-time.
License
MIT
Closing
Example
local showCubeFlag = FastFlag.new("ShowCube", false)
local function updateCube(visible: boolean)
script.Parent.Transparency = if visible == true then 0 else 1
end
updateCube(showCubeFlag.Value)
showCubeFlag.Changed:Connect(updateCube)
Documentation
Creating a FastFlag
FastFlag.new(name, defaultValue)
Properties of FastFlag
fastFlag.Name
fastFlag.Value
fastFlag.Changed
Listening to Changes
fastFlag.Changed:Connect(function(newValue)
end)
Disconnecting FastFlag
fastFlag:Disconnect()
Interacting with FastFlags
You can use this simple TypeScript class to interact with FastFlags.
// Remove "npm:" from import statement if you are not using Deno runtime
import { Universe, DataStore } from "npm:@daw588/roblox.js";
export default class FastFlags {
private static NAMESPACE = "FastFlags";
private universe: Universe;
private fastFlagsStore: DataStore;
public constructor(experienceId: number, apiKey: string) {
this.universe = new Universe(experienceId, apiKey);
this.fastFlagsStore = new DataStore(this.universe, FastFlags.NAMESPACE);
}
public async set<T>(name: string, value: T) {
await this.fastFlagsStore.SetAsync<T>(name, value);
await this.universe.PublishMessageAsync(FastFlags.NAMESPACE, JSON.stringify({
name,
value
}));
}
}
import FastFlags from "./fastflags.ts";
const fastFlags = new FastFlags(
0000000, // Experience Id
"" // OpenCloud API Key
);
fastFlags.set<boolean>("ShowCube", false);
FastFlag allows you to modify its value on the go while live in game. The cube example was showing me playing a live game of mine where I later on updated the FastFlag to false externally using JavaScript, where cube reacted to the FastFlag change by disappearing without me restarting the server.
You can think of it as a variable that you can change at anytime outside of Roblox that synchronizes across all of your running servers.
Yes, that’s also another use case, you can use FastFlags for pretty much anything that you want to update outside of Roblox without restarting the servers, it’s all synchronized real-time
You can use a JavaScript runtime, like Node.js, Deno, bun.js, etc. For Node.js you will have to transpile TypeScript to JavaScript, or simply remove types and run plain JavaScript.