In short
To make a survival game in Roblox Studio, build resource nodes (trees, rocks) that give materials when hit, an inventory kept on the server, a crafting system that checks recipes on the server, a hunger meter that drains over time, and a day and night cycle where nights are more dangerous. Then add building, more recipes and saving. Start small: one tree, one rock, three recipes and one night.
- Every count lives on the server: materials, hunger and crafted items. The client only asks to craft.
- Early recipes should need one or two common materials, so the first tool comes in the first minute.
- Nights give the loop its shape: gather by day, hide and defend by night.
On this page
What makes a survival game work
The loop in one line: gather, craft something that lets you gather faster or survive longer, get through the night, go further the next day.
| How often | What happens | What it needs from you |
|---|---|---|
| Every few seconds | Hit a tree, pick up a stone, eat | Clear feedback: a sound, a number, the item in the hotbar |
| Every minute or two | Craft a tool, a torch, a wall | Recipes that unlock in a sensible order |
| Every day cycle (10 to 15 minutes) | A night to survive | A threat at night and a reason to have a shelter |
| Every session | A better base, a new area, a boss | Saving, and goals beyond staying alive |
- A fast first tool. The first recipe should be possible within a minute: two sticks and a stone make an axe. Players who cannot craft anything quit.
- Pressure, not panic. Hunger and nights push players forward. Drain too fast and it becomes a chore; too slow and nothing matters.
- Tools that change how you play. An axe chops faster, a torch makes the night safe, a wall keeps things out. Each craft should feel like a step.
- Something to protect. A campfire or a base gives the night a centre and gives groups a reason to work together.
- Clear rules about death. Players should know what they lose when they die: everything, half, or nothing. Surprise losses feel unfair.
If your threat is endless waves of enemies rather than a hostile world, the zombie survival guide fits better.
The systems you need
| System | What it does | Roblox pieces | Guide |
|---|---|---|---|
| Resource nodes | Trees and rocks that give materials and grow back | Parts with attributes, ProximityPrompt or a tool hit | This page |
| Inventory | Counts each material per player | A server table, a RemoteEvent to show it | Inventory system |
| Crafting | Turns materials into items, checked on the server | RemoteFunction, a recipe table | This page |
| Hunger and health | Drains over time, food refills it | Player attributes, Humanoid:TakeDamage | This page |
| Day and night | Changes the light and the danger | Lighting.ClockTime | Day and night cycle |
| Night threats | Creatures that come out after dark | PathfindingService, Humanoid NPCs | NPC pathfinding |
| Building | Walls, floors and doors players place | A placement preview on the client, placement checked on the server | This page |
| Saving | Inventory and base between sessions | DataStoreService, plain values only | Data stores |
| World | Forests, hills, water | Terrain or parts | Terrain generator |
Build plan: from a baseplate to launch
First playable (one day and one night)
- Place resource nodes. A few trees and rocks as plain parts, each with a
Resourceattribute (Wood,Stone) and aProximityPrompt. On the server, a prompt trigger adds one of that material to the player's inventory and hides the node for a minute. - Add the crafting script below with three recipes and a simple crafting window: one button per recipe, each calling the RemoteFunction.
- Add hunger. A server loop lowers each player's
Hungerattribute every few seconds and damages them at zero; a berry bush refills it. - Add a day and night cycle and one night creature that wanders towards the nearest player after dark.
- Play one full day. Time how long the first axe takes, and whether the night feels tense or just annoying.
First public test
One small island, ten recipes, a campfire, hunger and nights. Watch three numbers: time to first craft, how many players survive the first night, and how long they stay after it. If most die on night one, make the first shelter cheaper; if nobody dies, nights need more teeth.
What to add for launch
- Building with a grid: walls, floors, a door, and a check on the server that the player owns the materials and the spot is free.
- Saving for the inventory and the base, stored as plain values (item names and counts, positions as numbers).
- Two or three areas that need better tools to enter: a cave that needs a torch, a snowy hill that needs warm clothes.
- Group play: a shared campfire, shared storage, and a reason to split jobs.
- Touch controls: hitting, crafting and placing must all work on a phone.
- The Maturity and Compliance Questionnaire in the Creator Dashboard, since night creatures and combat affect the rating.
The defining mechanic: crafting the server checks
Crafting is the heart of the genre, and the easiest place to cheat: if the client says "I made a sword", the server must not believe it. In this script the client only sends the name of a recipe. The server looks the recipe up, checks the player has every material, removes them and adds the result, all in one go, so a player cannot spend the same wood twice by sending two requests at once.
ReplicatedStorage
Craft RemoteFunction
ServerScriptService
Crafting Script new
-- Script in ServerScriptService named Crafting.
-- The inventory lives here, on the server. Clients ask to craft a recipe by name.
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local craft = ReplicatedStorage:WaitForChild("Craft") :: RemoteFunction
type Recipe = { needs: { [string]: number }, gives: string, amount: number }
local RECIPES: { [string]: Recipe } = table.freeze({
Axe = { needs = { Wood = 2, Stone = 1 }, gives = "Axe", amount = 1 },
Campfire = { needs = { Wood = 4, Stone = 2 }, gives = "Campfire", amount = 1 },
Wall = { needs = { Wood = 6 }, gives = "Wall", amount = 1 },
})
local inventories: { [Player]: { [string]: number } } = {}
local function inventoryOf(player: Player): { [string]: number }
local inventory = inventories[player]
if not inventory then
inventory = { Wood = 0, Stone = 0 }
inventories[player] = inventory
end
return inventory
end
-- Other server scripts (resource nodes, food) call this to add or remove items.
local function addItem(player: Player, item: string, amount: number)
local inventory = inventoryOf(player)
inventory[item] = math.max(0, (inventory[item] or 0) + amount)
player:SetAttribute("Item_" .. item, inventory[item]) -- the HUD reads these
end
craft.OnServerInvoke = function(player: Player, recipeName: unknown): (boolean, string)
if typeof(recipeName) ~= "string" then
return false, "Unknown recipe"
end
local recipe = RECIPES[recipeName]
if not recipe then
return false, "Unknown recipe"
end
local inventory = inventoryOf(player)
for item, count in recipe.needs do
if (inventory[item] or 0) < count then
return false, `Need {count} {item}`
end
end
-- no yields between the check and the change, so two requests cannot both pass
for item, count in recipe.needs do
addItem(player, item, -count)
end
addItem(player, recipe.gives, recipe.amount)
return true, `Crafted {recipe.amount} {recipe.gives}`
end
Players.PlayerAdded:Connect(function(player)
addItem(player, "Wood", 0) -- creates the inventory and the first attributes
end)
Players.PlayerRemoving:Connect(function(player)
inventories[player] = nil -- save it first, once saving is added
end)
The crafting window calls Craft:InvokeServer("Axe") and shows the message that comes back. To give the crafted item a body, clone a Tool with the same name from ServerStorage into the player's Backpack whenever gives is a tool. Resource nodes call addItem too; put it in a ModuleScript once more than one script needs it.
Hunger works the same way: a server loop every 5 seconds lowers a Hunger attribute by 1, and at 0 calls humanoid:TakeDamage(5). Eating sends a request, the server checks the food is in the inventory, removes it and raises the attribute. The client only draws the bar.
The hard part: balance and a world that refills
Two things make or break a survival game after the first hour: how fast resources come back, and how many objects the world holds.
- Respawn timers per node. A tree that is gone for good empties a server; one that is back in 10 seconds makes wood worthless. Start with about a minute for common nodes and several minutes for rare ones, and hide the node while it regrows instead of destroying and recreating it.
- A crafting ladder. Write every recipe in one table, as the script does, and read it as a tree: what does each item need, and what does it unlock? Each tier should take a little longer to reach than the one before.
- Hunger in minutes. Decide how long a full bar lasts (for example, one in-game day), then set the drain from that. Players should eat two or three times a day, not every minute.
- Fewer, bigger objects. Hundreds of trees made of many small parts and player bases with thousands of walls slow servers down. Use simple shapes, cap how many pieces one player can place, and turn on instance streaming once the map is large.
- Night threats that scale. More creatures for bigger groups, and fewer for a player alone, so solo players are not overrun.
Monetization that fits a survival game
Survival games are about earning your way, so selling the result of the grind removes the game. Sell comfort, looks and space instead:
| Roblox feature | Fits well | Turns into pay-to-win when |
|---|---|---|
| Game pass (bought once) | More inventory slots, a bigger base limit, skins for tools and buildings, a pet | It sells the best weapon or armour in a game with PvP |
| Developer product (bought again and again) | A revive that keeps your items, a starter kit for a new world | It sells top-tier materials in bulk |
| Private server (free or a monthly Robux fee) | Surviving with friends, keeping a base safe from strangers | Rarely: it is how many groups prefer to play |
| Subscription (monthly) | A monthly cosmetic, a daily bonus of common materials | The perk is power that free players cannot reach |
A developer product must be granted through MarketplaceService.ProcessReceipt so a purchase is never lost; the game pass guide covers pass checks and prompts. Changing the private server price cancels every active private server subscription, and a subscription must keep its benefits for the full term. Roblox also pays creators through Creator Rewards, which replaced engagement-based payouts on 24 July 2025. Rewarded video ads, where your game qualifies, must reward a developer product and cannot be random: a free revive fits.
What brings survivors back
- A saved base. The thing a player built is the strongest reason to return.
- Goals past survival. A boss, a map to explore, a boat to finish. Without them, day five feels like day one.
- Days survived. Show the count on screen and on a leaderboard. Beating your best is free content.
- Seasons and events. A blood moon night, a winter update with new recipes, a limited cosmetic.
- Daily rewards. A small daily bundle of materials (daily rewards).
Build a survival game with RoCode
RoCode is an independent AI agent for Roblox Studio. You describe what you want in a web chat, and its free Studio plugin writes the Luau and creates the scripts, parts and UI in the place you have open. For a survival game it works in rounds: first nodes and crafting, then hunger and nights, then building and saving.
Make the first playable version of a survival game: a small island with trees and rocks that give Wood and Stone through ProximityPrompts and grow back after 60 seconds, a server-side inventory, server-checked crafting for an Axe, a Campfire and a Wall with a crafting window, a hunger bar that drains and a berry bush that refills it, and a day and night cycle.
- Writes the server scripts for resources, crafting and hunger, and builds the island from parts
- Can add ready-made screens such as an inventory, a HUD, a shop and daily rewards
- Builds the game a working part at a time, so you can play each system before the next
- Takes screenshots in edit mode to check how the island looks
It cannot make custom meshes or animations, publish the game, or tell you whether your hunger drain feels right: you still play the nights yourself. Free credits every day, no card needed. How RoCode builds a game.
Questions
How do I make a crafting system in Roblox?
Keep a recipe table and each player's inventory on the server. The client sends only the recipe name; the server checks the materials, removes them and adds the item, as the crafting script on this page does.
Why should crafting run on the server?
Anything the client decides, an exploiter can change. If the client could say what it crafted, a cheater could make any item for free. The server checking every recipe stops that.
How do I make trees that grow back?
When a tree is used up, make it transparent and turn off its collision and prompt, wait the respawn time with task.delay, then show it again. Reusing the same part is cheaper than destroying and cloning a new one.
What is the difference from a zombie survival game?
A zombie survival game is about holding out against waves of enemies. A crafting survival game is about the world: gathering, crafting, hunger and nights. Many games mix both.
How big should the map be?
Small at first. A map players cross in a minute or two keeps them meeting each other and the resources close. Grow it with new areas once the core loop is fun.
Sources and further reading
- Roblox Creator Docs: RemoteFunction. OnServerInvoke and InvokeServer
- Roblox Creator Docs: ProximityPrompt
- Roblox Creator Docs: Lighting. ClockTime for day and night
- Roblox Creator Docs: data stores
- Roblox Creator Docs: Developer products
- Roblox Creator Docs: Subscriptions
- Roblox Creator Docs: Creator Rewards
- RoCode guide: Inventory system
- RoCode guide: Day and night cycle
How the code was checked: every script on this page passes Luau's strict type checker against Roblox's API definitions (luau-lsp, 4 November 2026). A type check catches misspelt APIs and wrong types, not game logic, so playtest in Studio before you publish.