> For the complete documentation index, see [llms.txt](https://f4-studio.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://f4-studio.gitbook.io/documentation/resources/f4-tycoon.md).

# f4-tycoon

A city-building board game for FiveM, played at a real 3D table: real dice, real props, AI players and optional stakes.

A board game for FiveM, played at a real table in your world. A table, four chairs and a printed city stand wherever you put them; players walk up, press **E**, sit down and play — roll the dice, buy districts, build them up from a flag to houses and a hotel, and collect rent from everybody who lands there. Two to four players, and AI players take the empty chairs.

It is standalone. The game itself needs no framework and no database. QBCore, Qbox or ESX is only used if you want people to play for a real-money stake.

## What it is for

* **Something to do at a table.** A café, a bar, a lounge, a gang's hideout, a prison yard — a place where people sit down together and stay for twenty minutes.
* **Game nights.** Several tables run games at the same time, each with its own players, its own stake and its own rules.

## What is in it

| Area          | What it covers                                                                                                                                                                                              |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **The table** | A table, four chairs, a printed board, dice, tokens, cards, buildings and cash — 89 custom models. Placed from the config or in game with one command.                                                      |
| **The board** | F4 City: twenty districts in eight zones, four landmarks, four headline spaces, rent day, tax, two contractors, the exchange, city hall and the gridlock corner.                                            |
| **Building**  | Land, up to three houses and a hotel on every district, each a prop in the owner's colour. Premium zones have hotels of their own; landmarks become a big wheel, a stadium, an opera house and a sky tower. |
| **Money**     | Every player's cash lies in front of them as piles of notes. Rent flies from the payer's pile to the owner's.                                                                                               |
| **Players**   | Two to four. The host fills empty chairs with AI players that sit down as people and play a real strategy.                                                                                                  |
| **Rules**     | Fourteen rules the host chooses per table — money, building, winning, pace — from the choices you allow in the config.                                                                                      |
| **Stakes**    | Optional real-money stakes with QBCore, Qbox or ESX. Nobody is charged unless everybody can pay.                                                                                                            |
| **Winning**   | A prestige target, the last player standing, a net worth target or a time limit.                                                                                                                            |

## How a game reaches players

The **server owns the game**. Each table runs its game in one thread on the server: it rolls the dice, holds every balance, checks every action and decides every rule. Clients only show what the server already decided.

Everything on the table is a **local prop** that each client builds for itself when it comes within `Config.SpawnDistance` of the table, and takes down again when it leaves. There are no networked entities, so there is nothing to own, nothing to clean up after a crash, and nothing another resource can grab.

{% hint style="info" %}
The dice are the one thing that looks random on every screen and is not: the server sends the two numbers and a seed, and every client throws the same physical dice from that seed. They bounce the same way and land on the same faces everywhere.
{% endhint %}

## Where to start

* [Requirements](https://f4-studio.gitbook.io/documentation/resources/f4-tycoon/getting-started/requirements.md) — what the server needs, which is very little.
* [Installation](https://f4-studio.gitbook.io/documentation/resources/f4-tycoon/getting-started/installation.md) — drop it in, put a table somewhere, sit down.
* [First Run](https://f4-studio.gitbook.io/documentation/resources/f4-tycoon/getting-started/first-run.md) — a whole game against the AI in five minutes.
* [Table Settings](https://f4-studio.gitbook.io/documentation/resources/f4-tycoon/configuration/table-settings.md) — what the host may change, and how you limit it.
* [Server Exports](https://f4-studio.gitbook.io/documentation/resources/f4-tycoon/developers/server-exports.md) — for the resource that wants to know who won.
