Tutorial · 12 min read · Updated October 2026
How to make a Roblox pet simulator with AI, step by step
In a pet simulator the pets are the game: players break things to earn coins, hatch eggs for pets, and chase rarer pets to break things faster. That makes every egg roll and every pet in the inventory a target for exploiters. The eight messages below build a complete pet simulator inside your own Roblox Studio place, with every roll, every coin and every pet owned by the server. They are written for ForgeBlox (formerly Forge) and work as a checklist with any AI.
Want a plain clicker with pets as a side feature instead? Use the simulator guide. This one goes deep on the pet systems.
Before you start
- Roblox Studio open on a new Baseplate, saved once so it has a name.
- Studio ▸ Assistant ▸ ⋯ ▸ Manage MCP Servers ▸ Enable Studio as MCP server. Not turning green? See MCP not connecting.
- ForgeBlox Bridge running and paired. Download.
- Pet models: start with simple placeholder models (the AI can build blocky ones) and swap in real art later. Keep each pet as a Model with a PrimaryPart.
- Model: Sonnet 5.5. Budget about 3,000 to 7,000 credits ($30–70) for the whole sequence; see pricing.
Message 1: breakables and coins
Build the core of a pet simulator. Server owns PlayerData and a Coins
leaderstat. Add a Breakables folder in Workspace with 20 coin piles in
Zone 1, each with a Health attribute (50) and a Reward attribute (10).
When Health reaches 0 the server awards Reward coins to every player who
damaged it, scaled by damage share, plays a burst effect, and respawns the
pile after 8 seconds. For now the player can click a pile to deal 5
damage through a Damage remote: the server checks the pile exists, is in
range (30 studs) and rate-limits to 8 per second. Playtest, break two
piles, screenshot, stop.
What to check: the Damage remote sends only which pile, never an amount. Damage numbers come from the server.
Message 2: eggs and rarities
Add an egg system. ReplicatedStorage/Config/Eggs is a ModuleScript: each
egg has id, price, and a list of { petId, weight }. Basic Egg costs 100
coins: Dog 45, Cat 35, Bunny 15, Bear 4.9, Dragon 0.1. Pets are in
ReplicatedStorage/Config/Pets with { id, name, rarity, power }. On the
server, Hatch(eggId) checks coins, deducts, rolls against cumulative
weights with Random.new(), creates a pet record { uid = HttpService
GUID, petId, golden = false }, and returns the result. The client plays a
hatch animation (egg shakes, flashes, reveals the pet name and rarity
color) using only the returned result. Add an Egg stand with a
ProximityPrompt. Hatch five, screenshot the reveal.
The client animates; the server decides. If the AI rolls on the client "for the animation", stop and ask it to move the roll to the server.
Message 3: pets that follow and attack
Equipped pets follow the player: the server keeps the list of equipped
uids; each client renders every player's equipped pets locally and moves
them in a formation behind the character with lerp each frame. When the
player clicks a breakable, equipped pets move to it and attack. The
server applies damage every 0.5 seconds per pet equal to its power while
the pet's owner is targeting that pile and is within range. Remove the
click damage from message 1 once pets work. Equip 3 pets, break a pile,
screenshot.
Pets are rendered on each client so the server is not moving dozens of models. Only the damage is server work.
Message 4: inventory and equip slots
Add a pet inventory UI (scale-based, works on phones): a grid of owned
pets sorted by power, with rarity colors. Click a pet for Equip,
Unequip and Delete. Max 3 equipped, max 50 stored; hatching at 50 shows
"Inventory full". Add an Auto-delete setting per rarity (Common, Rare)
stored in PlayerData; the server deletes matching pets right after the
roll and still shows the reveal. Every action is a remote the server
validates: the uid exists and belongs to the player. Screenshot the
inventory with 10 pets.
Message 5: golden pets
Add a Golden Machine. The player selects one petId; if they own at
least 5 non-golden pets of that id (none equipped), the server removes
exactly those 5 records and adds one record with golden = true. Golden
pets have 2.5x power and a gold material tint. Validate everything on
the server, including that the 5 uids are distinct. Playtest: hatch
until you have 5 Dogs, craft, screenshot.
Ask for "exactly those five uids" and "distinct". A crafting remote that trusts a count is how pets get duplicated.
Message 6: pet index and a second zone
Add a Pet Index UI listing every pet in Config/Pets, greyed out until
discovered. Discovered petIds are saved. Discovering all pets of an egg
grants a one-time +10% coin bonus. Add Zone 2 behind a door costing 5,000
coins (server-gated, saved), with piles worth 5x and a Forest Egg at
1,500 coins with its own pets. Screenshot the index and Zone 2.
Message 7: saving and game passes
Save Coins, pets (as records keyed by uid), equipped uids, discovered
pets, auto-delete settings and unlocked zones with DataStoreService:
session-locked with UpdateAsync, autosave every 60 seconds, save on
leave and on BindToClose. Add two game passes with placeholder ids:
Triple Hatch (hatch 3 at once for 3x price) and +2 Equip Slots, checked
on join with UserOwnsGamePassAsync in a pcall and granted immediately
on PromptGamePassPurchaseFinished. Test: hatch, equip, stop, start,
confirm the same pets are equipped.
For Robux products like coin packs or egg luck, use one ProcessReceipt with idempotent grants; the game pass guide has the exact prompt.
Message 8: the security pass
Review every RemoteEvent and RemoteFunction handler on the server:
validate argument types, check every uid belongs to the caller, check
range to breakables, rate-limit Hatch, Equip, Delete and Craft, and
confirm no client-sent number is trusted anywhere. Fix what you find and
summarise the changes.
Numbers that feel good
| Thing | Starting value | Why |
|---|---|---|
| First egg | 100 coins (about two minutes of breaking) | A pet in the first few minutes is the hook |
| Rarest pet | 0.1% to 1% weight | Rare enough to chase, not so rare it feels fake |
| Golden recipe | 5 of a kind for 2.5x | Turns duplicate Commons into progress |
| Zone 2 door | About 50x the first egg | A clear next goal that takes a session to reach |
Show odds on the egg stand. Players trust a game that shows its odds, and it is the honest thing to do.
What it costs
On Sonnet 5.5 this sequence runs about 3,000 to 7,000 credits ($30–70), more if you add many pets or redo the UI several times. Packs: $10 = 1,000 credits, $25 = 2,750, $60 = 7,200, $150 = 19,500, credits never expire. Frequent builders can use Builder ($19/month, 2,000 credits) or Pro ($49/month, 5,600 credits). Every message shows its price before you send it.
Common mistakes the playtests catch
- Rolling the egg on the client so the animation "knows" the result.
- Saving pets as a count per type instead of records with uids, which breaks golden crafting and equipping.
- Moving every pet on the server, which lags with 12 players.
- Forgetting BindToClose, so pets hatched in the last minute vanish when the server shuts down.
Related guides
- How to make a Roblox simulator with AI: the clicker loop, rebirths and zones.
- How to make a Roblox idle game with AI: offline earnings and big numbers.
- How to make a Roblox UI with AI: inventories and shops that work on phones.