Tutorial · 12 min read · Updated November 2026
How to make a garden game on Roblox with AI (Grow a Garden style)
Gardening games are some of the most played experiences on Roblox right now. Grow a Garden set records, and its sequel opened to hundreds of thousands of players at once. The loop is gentle: buy seeds, plant them in your own plot, wait, harvest, sell, buy better seeds. This guide shows how to build an original garden or farming game inside your own Roblox Studio place, with the hard parts (offline growth, a shop that matches across servers, safe saving, thousands of fruit without lag) done properly. The prompts are written for Forge and work as a checklist with any AI agent.
The loop, piece by piece
- Your plot. Each player gets one fenced plot when they join, for example 6 plots per server, each with up to 60 plants placed freely on soil. The plot is home: everything else happens around it.
- Seed shop. A central shop sells seeds. Its stock restocks every 5 minutes with a countdown. Common seeds are almost always in stock; rare ones show up in maybe 1 restock out of 20. Waiting for the restock is a big part of why players stay.
- Planting and growing. A seed becomes a plant that grows through 3 to 4 visible stages. Cheap crops ripen in about a minute; expensive ones take 20 minutes or more.
- Single and multi-harvest crops. A single-harvest crop is used up when picked. A multi-harvest plant (a berry bush, a fruit tree) keeps growing new fruit every 1 to 3 minutes, up to a cap of around 5 fruit at once. Those are the long-term investments.
- Fruit weight. Every fruit rolls a weight when it appears, so two strawberries are never worth quite the same. Rare giant fruit are what players screenshot and show off.
- Mutations. A small chance on each fruit for a special state that multiplies its value and changes how it looks. Weather events raise those chances.
- Selling. Players carry harvested fruit in a backpack (capped, say 200 items) and sell at a stand. Value = base price × weight × mutation multipliers.
- Weather and events. Every 15 to 20 minutes, a server-wide event runs for a few minutes: rain that speeds growth, a frost that adds a mutation, a meteor shower that drops rare seeds. Events are when everyone crowds outside to watch their plot.
- Gear. Watering cans, sprinklers and fertiliser that speed growth or raise mutation chances in an area. They give coins somewhere to go once seeds feel cheap.
Why it is harder to build right than it looks
A first version where a seed turns into a plant is easy. Most garden games feel broken because of what is underneath.
Growth must be computed, not counted
The tempting version runs a loop per plant that adds growth every second. With 6 players and 60 plants each, that is 360 loops, and growth stops the moment the player leaves. Instead, store plantedAt (from os.time()) and the crop's grow time. The stage is just (now - plantedAt) / growTime, worked out when it matters: when the plot loads, when the player tries to harvest, and on one shared tick every few seconds that updates visible stages. Plants then keep growing while the player is offline for free, and the server decides when something is ripe. Use workspace:GetServerTimeNow() on the client for countdowns so they match the server.
The server owns every seed, fruit and coin
Remotes carry intent only: "plant seed X at this spot", "harvest plant 12", "sell everything". The server checks the player owns the seed, the spot is inside their own plot and not too close to another plant, the plant is ripe, the backpack has room, and rate limits each remote. It rolls fruit weight and mutations itself and computes the sale price itself. A client that sends a price or a weight is ignored.
A shop that matches across servers
Players compare stock in Discord, so every server should agree. Roll the stock with Random.new(math.floor(os.time() / 300)) and the same weighted table, and every server gets the same stock for that 5-minute window without any cross-server messaging. Track each player's purchases per window on the server so a stock limit of, say, 3 per seed cannot be bypassed by rejoining.
Saving must be session-locked and compact
A garden is a lot of data: up to 60 plants with fruit, a backpack, gear and seeds. Use DataStore UpdateAsync with a session lock so two servers never write the same player at once, give every plant a unique id, and save on leave and in BindToClose. Store compact records (crop id, position on the plot grid, plantedAt, fruit list) rather than instance data, so you stay far under the 4 MB per-key limit as gardens grow.
ProcessReceipt must be idempotent
Robux products like a seed restock or a growth boost go through one ProcessReceipt callback that records each PurchaseId before granting, so a retried receipt never grants twice. The game pass guide has the full pattern.
Performance with six full gardens
360 plants with up to 5 fruit each is close to 2,000 visible objects before decorations. What keeps it smooth on phones:
- The server holds only data. Each client builds the plant and fruit models from that data.
- A few pre-made stage models per crop (sprout, small, full) swapped at stage changes, instead of scaling every plant every frame.
- Plants and fruit anchored with
CanCollide,CanTouchandCanQueryoff; harvesting uses one ProximityPrompt or click target per plant, not per fruit. - StreamingEnabled on, so far-away plots are not fully loaded.
- Simple meshes with shared materials, and a hard cap on plants per plot.
A Crops module: every number in one place
Put every crop, price, grow time and mutation in one ModuleScript, ReplicatedStorage/Config/Crops. Scripts read from it and never hard-code a crop. Balancing becomes editing one table, and a new crop for an update is one new entry plus a model.
-- ReplicatedStorage/Config/Crops (shape only)
return {
currency = "Coins",
crops = {
{ id = "moon_carrot", name = "Moon Carrot", rarity = "Common",
seedPrice = 10, sellBase = 8, growTime = 60, multiHarvest = false },
{ id = "glow_berry", name = "Glow Berry", rarity = "Uncommon",
seedPrice = 120, sellBase = 25, growTime = 180, multiHarvest = true,
regrowTime = 90, maxFruit = 5 },
-- Rare, Epic, Legendary ...
},
weight = { min = 0.8, max = 1.6, giantChance = 0.01, giantMult = 3 },
mutations = {
{ id = "Dewy", mult = 2, chance = 0.02 },
{ id = "Frosted", mult = 3, chance = 0 }, -- only during Frost
{ id = "Starlit", mult = 10, chance = 0.001 },
},
}
The starter prompt for Forge
Paste this as your first message. It sets the rules for the whole build and does Phase 1.
We are building an ORIGINAL Roblox gardening game. Do not use any
names, models, art or UI from existing games. Theme: a farm on the
moon. Every crop, price, grow time and mutation comes from
ReplicatedStorage/Config/Crops.
Crops for now (placeholder models, 3 growth stages each):
Moon Carrot (seed 10, sells 8, 60 s, single harvest)
Glow Berry (seed 120, sells 25, 180 s, multi-harvest, regrow 90 s,
max 5 fruit). Add 4 more up to a Legendary that takes 20 minutes.
Rules for the whole build: the server owns all coins, seeds, plants,
fruit, weights and mutations. Remotes send intent only, never prices,
weights or owners, and every remote validates types, plot ownership,
distance and rate. Growth is computed from plantedAt with os.time(),
never with a loop per plant, so plants grow while players are
offline. The server stores only data; clients build the plant
visuals. Save with DataStore UpdateAsync, session-locked, each plant
a record with a GUID.
We work in 6 phases and I will say "next" between them:
1 plots + growth + selling, 2 seed shop, 3 weight + mutations,
4 weather, 5 map + UI + performance, 6 monetization + balance.
Phase 1 now: 6 plots, one per player on join, up to 60 plants each,
plant a seed by clicking soil in your own plot, growth stages, a
harvest prompt when ripe, a backpack capped at 200, a sell stand,
and saving. Playtest with 2 clients: plant, wait, harvest, sell,
stop, start again, confirm the plants kept growing. Screenshot.
Follow-up messages, one per phase
Phase 2: the seed shop.
Next. Add a seed shop at the market. Stock restocks every 300 s and
is rolled with Random.new(math.floor(os.time() / 300)) from a
weighted table, so every server shows the same stock. Commons nearly
always appear, the Legendary about 1 restock in 20. Limit 3 of each
seed per player per restock, tracked on the server and saved so
rejoining does not reset it. Show a countdown from
GetServerTimeNow. Test across two server instances if you can, and
screenshot the shop.
Phase 3: weight and mutations.
Next. When a fruit appears, the server rolls its weight between 0.8
and 1.6 (1% chance of a giant at 3x) and checks each mutation in the
Crops module. Sale value = sellBase x weight x mutation multipliers.
Show the weight and mutation on hover and in the backpack. Mutation
visuals (a material, a colour, a small particle) are spawned on the
client only. Print 1,000 test rolls so I can check the odds, then
screenshot a plot with mutated fruit.
Phase 4: weather events.
Next. A server weather scheduler: every 15 to 20 minutes, pick one
event for 3 minutes. Rain: growth 1.5x and Dewy chance x5. Frost:
fruit that appear can become Frosted. Meteor shower: a few rare
seeds land on random plots. Announce each event to the server, change
the sky and lighting on the clients, and make sure growth math uses
the speed-up correctly across the event boundary. Screenshot each.
Phase 5: map, UI and performance.
Next. Lay out 6 plots around a central market with the seed shop,
sell stand and a gear shop (watering can: +25% growth in a small
area for 60 s; sprinkler: placeable, +10% growth in range). Build a
scale-based HUD (coins, backpack count, next restock, current
weather), a seed shop panel and a backpack panel that work on a phone.
Turn on StreamingEnabled. Fill one plot with 60 plants and check the
device emulator on a phone preset. Screenshot from above and on phone.
Phase 6: monetization and balance.
Next. Add placeholder-id game passes: 2x Sell, Bigger Backpack, +20
Plant Slots, Auto Sprinkler. Add developer products: Instant Restock
(for the buyer only), 15-minute Growth Boost, and Summon Rain (a
server-wide rain event, announced with the buyer's name). One
ProcessReceipt, idempotent by PurchaseId. Then review every remote
for type, range, plot ownership and rate checks, and print a table
of time-to-afford for each seed so I can balance. Summarise.
Create the real passes and products on the Roblox website and paste their ids into the constants. The agent cannot do that part.
Monetization ideas that fit the loop
| Product | Type | Why players buy it |
|---|---|---|
| 2x Sell | Game pass | Every harvest is worth double, forever |
| Bigger backpack | Game pass | Fewer trips to the sell stand |
| +Plant slots | Game pass | A bigger garden earning at once |
| Instant restock | Developer product | A new roll of the shop without waiting |
| Growth boost | Developer product | Faster harvests for a short session |
| Summon weather | Developer product | Boosts the whole server, so the buyer gets a shout-out |
Show shop odds and mutation chances in the game. Many of your players are kids, and a game that shows its odds is the honest one.
Honest limits
- The AI builds systems; it does not make a hit. Garden games live on update rhythm: new crops, new events, new seasons every week or two. That plan is yours.
- Art takes iteration. A consistent crop style needs a locked style prompt or a small set of models you make or license. Expect to regenerate or swap some.
- Balance needs real players. The time-to-afford table is a starting point. Retention from a soft launch tells you whether a 20-minute crop feels exciting or boring.
- Trading is a separate project. Player-to-player trading brings scams and duplication risks. Add it later, with a two-sided confirm screen and server-side checks, not in the first build.
- You still review the code. Read the remote handlers yourself, or ask for the security pass again after every big change.
- Cost. On Sonnet 5.5, all six phases typically run several thousand credits, more if you go back and forth a lot. Every message shows its price before you send it; see pricing.
Questions
Can I copy Grow a Garden?
No. Planting, growing, selling and a restocking shop are a genre many games share, but the plant models, art, names, mutation names, UI and branding of Grow a Garden belong to its developer. Build the loop yourself and give it your own theme, crops and art.
How do plants keep growing when the player is offline?
Do not run a timer per plant. Save the time each plant was planted, and compute elapsed time from os.time() whenever the server needs the stage. When the player rejoins, every plant is exactly as grown as it should be.
How do I make the seed shop show the same stock in every server?
Roll the stock from a seed made of the current five-minute window, such as math.floor(os.time() / 300). Every server rolling the same table with the same seed gets the same stock, with no cross-server messaging.
Why does my garden game lag with a full server?
Keep only data on the server and let clients build plant visuals, anchor everything with collisions and queries off, swap a few stage models instead of tweening every frame, cap plants per plot and turn on StreamingEnabled.
How long does it take to build with AI?
The six phases take an afternoon to a weekend of prompting and playtesting. Balancing prices and grow times takes longer, and you learn it from real players.
Related guides
- How to make a Roblox simulator with AI: the collect-sell-upgrade loop, rebirths and zones.
- How to make a Roblox idle game with AI: offline earnings, big numbers and prestige.
- How to make a Roblox pet simulator with AI: weighted rolls, rarities and an index.
- How to make a Roblox UI with AI: shops and backpacks that work on phones.
- Game pass and developer product scripts with AI: idempotent ProcessReceipt.