2D — AgarIO Fully Scripted
Complete Roblox Source Code | Production-Ready | Fully Documented
About This Template
This is a full implementation of the agar.io genre on top of Roblox, set in a 9000 × 9000-unit world where players control round cells that compete against other players and AI bots. What you get is not a gameplay prototype — it is a complete game package with progression, monetization, social, and administration systems already wired together, ready to be rebranded and shipped without rewriting the foundation.
The game loop runs at a 60 Hz physics tick with a 15 Hz client broadcast using delta-state synchronization for bandwidth efficiency. All state is server-authoritative, which makes the project significantly more resistant to common exploits than client-side templates.
Key Features
Core Gameplay
- Faithful agar.io physics — radius from mass, inverse-radius speed scaling, logarithmic mass decay, automatic split at mass 22,500
- Precise split mechanics — split boost is inversely proportional to radius (small cells fly far, large cells nudge), per-cell aim toward the cursor, recoil applied to the source cell
- Simultaneous eject system — every player cell ejects a pellet at once with a fixed mass cost, complete with exponential friction and an 8-second pellet lifetime
- Advanced virus system — paper-based adaptive mass distribution with three modes (Uniform / Slight Variation / Partial Retention), explosion arcs that intelligently avoid sibling cells, and player-driven virus shooting via feed
- Authentic merge logic — radius-based merge condition with a 4-iteration push-collision pass per tick for stability
Realistic Bot AI
- Four prioritized behaviors: Flee → Hunt → Food → Wander
- Human-like behavior: 0.18s reaction delay, cursor jitter, 8% per-frame mistake probability
- Wall avoidance, inter-bot separation, aggressive split when chasing prey
- Dynamic bot count that scales with the active player count
- Bot names pulled from an external API with a hardcoded fallback list
Progression & Rewards
- Infinite leveling with the formula expForLevel(L) = floor(1000 × L^1.5) — EXP earned from positive mass deltas
- Milestone Level Rewards at levels 3, 5, 10, 15, 20, 25, 30, 35, 40, and 50 (coins, EXP, or exclusive skins)
- Daily Rewards with a 7-day streak — deterministic per-player, per-week reward generation via seeded RNG
- Daily Quests (3 random quests per day) with 7 quest templates and 3 difficulty tiers: kill_game, kill_day, reach_mass, hold_mass, eat_food, survive_time, split_count
- Automatic streak-reset detection (week rollover and missed-day handling)
Economy & Shop
- Passive coin income of 2 coins per minute while playing
- Multi-category shop: Premium Skins, Featured Country Skins, Standard Country Skins (60+ countries), Level/Redeem/Group exclusive skins, plus Custom Name and Custom Skin items
- Dynamic Skin System — admins can add new skins live via DataStore without redeploying
- Robux Developer Products preconfigured (5 tiers from 1,000 to 120,000 coins)
- Coin and item gifting to other players, secured through a pendingCoinGifts flow
- Redeem Code System with DataStore-backed admin management, max-uses, expiry, and three example seed codes included
Social & Community
- Invite & Friend Boost — +10% XP per friend in the same server, capped at +100% (2× XP)
- Server Region Detection via ip-api.com with caching
- Cross-server Server List & Teleport powered by MemoryStoreService (35s TTL, 25s register interval)
- Group System with Roblox Group integration: exclusive skins, a one-time reward, and a 3.5× spawn-mass boost for active group members
- Favorite Prompt triggered on first death and recurring every 3 days
- Custom System — per-player custom chat tag, custom display name, and custom skin uploads with use-count tracking
- Global Leaderboards via OrderedDataStore for total coins, total EXP, and total kills
Player Settings
Four user-controllable settings synced live: dark theme, in-game leaderboard visibility, movement-arrow indicator, and background music. All persisted to the player profile and synchronized through the settingsSync packet.
Admin Panel
- Server-side: AdminConfig, AdminRanks, AdminBans, AdminCommands, AdminServer
- Game-state exposure through _G.AgarGameState and a BindableFunction registry
- Admin Spectate with camera override
- addSkin admin command for the dynamic shop — no redeploy needed
- Companion client-side admin panel and admin message UI
Technical Specifications
| Category | Detail |
|---|---|
| Engine | Roblox Studio, Luau |
| Genre | Mass/Cell Game (Agar.io-style) |
| Networking | ByteNet (binary serialization) — 48 packet definitions |
| Persistence | ProfileStore (built on DataStoreService) |
| Cross-server data | MemoryStoreService (server list), OrderedDataStore (rankings) |
| Physics tick | 60 Hz fixed timestep |
| Broadcast rate | 15 Hz with delta state + 5-second full sync |
| Spatial optimization | Spatial hash, bucket size 200, for food queries |
| Viewport culling | viewR = 580 + sqrt(totalMass) × 28 + 400 with a 40% margin |
| Max cells per player | 16 |
| Max bot cells per server | 80 |
| External APIs | ip-api.com (region detection), external name service for bot names |
| Studio environment | Automatic separate DataStores (*_Test suffix) |
What's Included
Complete source code (ServerScriptService, StarterPlayerScripts, StarterGui, ReplicatedStorage)
14+ integrated ModuleScript systems
48 ByteNet packet definitions, ready to use
Full UI suite: MenuShop, MenuSkins, MenuCoins, MenuProfile, MenuServer, MenuSettings, MenuRanking, MenuDaily, MenuLevelReward, MenuQuest, MenuServerList, MenuCustom, MenuGroup, SmartCamera, FoodRenderer, DeadPopup
Sound assets (Pop, Eat, LevelUp, Buy, Hover, Click, Reward)
Mobile control GUI
Server-side and client-side admin panels
26-section technical documentation covering every formula, constant, and system flow
Who Is This For?
- Studios and developers who want to ship a .io-style game on Roblox with a short time-to-market
- Solo developers looking for a solid foundation to fork and reskin into a unique IP
- Luau learners studying production-grade architecture: ProfileStore, ByteNet, server-authoritative physics, MemoryStoreService
- Game investors seeking a mechanically proven template that only needs rebranding
Why Choose This Template?
- Not a prototype — production-ready — every system that usually becomes a bottleneck (persistence, leaderboards, monetization, admin tooling) is already built
- Fully server-authoritative — physics, validation, and economy all live on the server, reducing the attack surface for exploiters
- Performance-conscious — spatial hashing, viewport culling, delta broadcasting, and binary serialization throughout
- Modular and extensible — systems are isolated in ModuleScripts with clear responsibilities, making them easy to disable, swap, or extend
- Dynamic content — skins, redeem codes, and ban lists can all be managed live via DataStore without redeploying
- Professional documentation — 26 detailed sections covering every formula, constant, and system flow
Try the Live Demo
Experience the template in action before purchasing: https://www.roblox.com/games/91732525529328
