For the complete documentation index, see llms.txt. This page is also available as Markdown.

Foosball - Table Football/Soccer

Bring your FiveM city to life with the Foosball Script — a fully interactive, synchronized, and endlessly fun minigame that fits perfectly into bars, clubs, houses, or any custom interior.

📥 Play it now!

📸 Preview

📦 Features

Fully synced multiplayer gameplay (requires OneSync) ✅ Standalone or framework-compatible — works with ESX, QBCore, or no framework at all ✅ Configurable rules — set match type (solo, 1v1, 2v2), who starts, goals to win, defenders, strikers, and even one-leg or two-leg foosball ✅ Custom play prices — charge with money, items, or tokens ✅ Business integration — link table income to a job or society, or make tables playable only when staff are nearby ✅ Smooth and responsive controls — play in simple or advanced mode, mouse or keyboard-based ✅ Custom skins & cosmetics — 12 colors, 11 hats, 2 skin tones, all configurable via store ✅ In-game Store NPCs — define vendors who sell cosmetics with your chosen economy ✅ Donation or event-exclusive cosmetics — lock rare items behind custom currencies or events ✅ 3D positional sound — immersive and realistic match atmosphere ✅ Optimized and lightweight — built for RP and public servers ✅ Configurable HUD & Controls — all shortcuts editable from config ✅ Event system — trigger rewards automatically when a player wins ✅ Customizable table placement — place tables anywhere via config or mapping tools ✅ Localization ready — includes English, Spanish, and supports all FiveM locales


⚙️ Installation

1️⃣ Dependencies

  • Framework (autoselected or choose one):

    • ESX Legacy

    • QBCore

    • Your custom framework

    • Standalone

  • Target system (autoselected or choose one):

    • ox_target

    • qb-target

    • Your custom target system

    • Standalone

  • Notification system (autoselected or choose one):

    • ox_lib

    • ESX Legacy

    • QBCore

    • Your custom notification system

    • Standalone

  • Persistence system (autoselected or choose one):

    • oxmysql

    • Your custom persistence system

    • Standalone

  • Inventory Hud system (autoselected or choose one):

  • OneSync (required for multiplayer sync)

2️⃣ Add Resource

  • Download and install:

    • sverse_table_football

    • sverse_table_football_assets

    Place them inside your resources folder wherever you want.

3️⃣ Add to server.cfg

4️⃣ Table Integration

  • Define tables directly inside config/basic.lua under Config.tables.

  • Or place them dynamically through your housing or mapping system.

  • Each table can have its own price and business owner.

5️⃣ Customization Store

  • Add NPC vendors in config/economy.lua under Config.stores.

  • Customize items, prices, and currencies freely.


🎮 How to Play

1️⃣ Approach any foosball table and press E to start or use third eye. 2️⃣ Play solo, 1v1, or 2v2 depending on who joins. 3️⃣ Use your mouse and keyboard to control the bars and shoot. 4️⃣ Customize your player’s color and hat during the match with U. 5️⃣ The game keeps running as long as one player stays, no time limit. 6️⃣ All animations, goals, and sounds are synced for everyone nearby.


🧠 Configuration Overview

All main settings are located in config/basic.lua and config/economy.lua.

🗺️ Basic Setup

  • Define language, framework, and integration type

  • Place tables anywhere using coordinates and heading

  • Set per-table custom prices and business ownership

⚙️ Game Options

💰 Economy Settings

🎨 Store Customization

Over 12 team colors and 11 hats — all individually priced and editable:


🧩 Exports

Client-side exports that let external scripts drive the foosball flow without going through the interaction prompt or the NUI setup menu.

showStore()

Opens the cosmetics store NUI for the calling player.


showLeaderboard()

Opens the leaderboard NUI for the calling player.


joinTableByEntity(entity)

Joins the calling player to a table whose match is already running, as if they had walked up and pressed the interaction key. No NUI is opened. The closest free spot (side + position) is picked automatically.

Failure reasons:

  • invalid_entity — entity is nil or does not exist.

  • table_not_found — entity is not a tracked foosball table (player must be within ~50m for the table to be registered).

  • already_playing — the caller is already playing another table.

  • game_not_started — the table is idle; use startGameOnEntity instead.

  • no_spot_available — no free spot left on the table.


startGameOnEntity(entity, gameMode)

Starts a new match on an idle table with the supplied game options, bypassing the setup NUI. The caller is placed on the closest available spot.

Failure reasons:

  • invalid_entity — entity is nil or does not exist.

  • table_not_found — entity is not a tracked foosball table.

  • already_playing — the caller is already playing another table.

  • game_already_running — the table is not idle.

  • no_spot_available — no free spot left on the table.

  • invalid_type / invalid_range / invalid_value / invalid_optiongameMode validation failed; the third return value is the field name.


exitCurrentGame()

Leaves the match the caller is currently playing. Releases the table spot, hides the HUD and restores the camera, as if the player had pressed the cancel key.

Failure reasons:

  • not_in_game — the caller is not currently playing any table.


🧑‍💻 Game Win Event

Server-side event triggered when a game finishes. Provides full details about the game and participants.


FAQ

Q: Can I play solo? A: Yes, the game is started once the setup is done.

Q: Can I use tokens or any item instead of money? A: Absolutely, set currency = "token" in Config.defaultPlayPrice.

Q: Does it support my framework? A: Yes, it automatically detects ESX, QBCore, or runs standalone.

Q: Can I make tables work only when employees are nearby? A: Yes, enable Config.business.requiresEmployeeNearby = true and Config.business.enable = true

Q: Is everything synced for nearby players? A: Yes, goals, shots, and player movements are fully synchronized with OneSync.

Q: Is it optimized? A: Fully. Lightweight and tested for heavy RP servers.


⚠️ Credits Notice All hat models assets included in this resource belong to Zekirakm. Used and distributed under their license/permission.

Last updated