Guides
Script a game system
Rounds, currencies, quests, leaderboards: systems that run on the server and survive rejoining.
Game systems are where the agent saves you the most time: the logic, the remote events, the data saving and the edge cases nobody enjoys writing. This guide builds a round system.
The request#
Make a round system. 20 second intermission in the lobby, then
teleport everyone to the spawns in Workspace.Arena. The round lasts
2 minutes or until one player is left. The winner gets 50 Coins on
the leaderboard. Show the timer and the status at the top of the screen.What the agent does#
- Reads
Workspace.Arenato find the spawn points, and checks for an existing leaderboard orCoinsvalue. - Writes the round loop as a server
ScriptinServerScriptService, keeping state on the server where players cannot tamper with it. - Adds the
leaderstatsfolder if there is none, and saves Coins with a data store, citing the documentation it used for the limits. - Puts the timer and status into a small HUD, updated from the server through attributes or a
RemoteEvent. - Handles the cases that break naive versions: players leaving mid-round, joining mid-round, and nobody being left.
Check it#
Use Test → Clients and Servers with two or three players so you can see a round actually end. Watch the Output window: the agent writes clear messages for anything it expects might go wrong.
Refine it#
- "Players who die go back to the lobby to spectate."
- "Pick a random map from ServerStorage.Maps each round."
- "Give everyone 10 Coins for taking part."
Tips#
- Give exact numbers: times, rewards, player counts.
- Say where things live if they exist already.
- Ask the agent to explain the system when it is done. It will walk through the scripts it wrote, which is useful the first time you need to change them yourself.