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):

  • Target system (autoselected or choose one):

  • Notification system (autoselected or choose one):

  • Persistence system (autoselected or choose one):

    • 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

ensure sverse_table_football
ensure sverse_table_football_assets

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

-- 🌐 Language and Framework Settings
Config.locale = "en" -- Language code for translations (e.g. "en", "es")
Config.framework = "auto" -- Framework detection: "es_extended" | "qb-core" | "standalone" | "auto"
Config.interaction = "auto" -- Interaction system: "ox_target" | "qb-target" | "standalone" | "auto"
Config.persistence = "auto" -- Data persistence layer: "oxmysql" | "standalone" | "auto"
Config.notification = "auto" -- Notification system: "ox_lib" | "es_extended" | "qb-core" | "standalone" | "auto"
Config.inventoryHud = "auto" -- Inventory system: "esx_inventoryhud" | "qb-inventory" | "ox_inventory" | "standalone" | "auto"
  • Place tables anywhere using coordinates and heading

  • Set per-table custom prices and business ownership

-- ⚙️ Table Setup
-- Each entry defines a foosball table in the world.
-- position: table center | heading: facing direction
Config.tables = {
    {
        position = vector3(-1080.936279, -253.305496, 44.006592),
        heading = 206.763779,
        owner = nil, -- Set to nil for public table, or a organization/job/society name, needs Config.business.enabled = true in economy.lua
        -- Optional per-table default price override, set price to nil to make it as default in Config.defaultPlayPrice
        price = {
            amount = 50,
            -- item name
            currency = "money"
        }
    }
}

⚙️ Game Options

-- ⚽ Default Game Settings
Config.defaultGameOptions = {
    mode = '2v2',           -- Match type: '1v1' or '2v2'
    bestTo = 4,             -- Number of goals to win (e.g. 4 means "first to 4")
    whoStarts = 'random',   -- Starting team: 'red' | 'blue' | 'random'
    goalkeeper = 1,         -- Row index for goalkeeper (0–5)
    defender = 2,           -- Row index for defender
    midfielder = 5,         -- Row index for midfielder
    forward = 3,            -- Row index for forward
    legs = "single",        -- Match format: 'single' or 'double'
}

💰 Economy Settings

-- 💰 Play Price Settings
-- Define the cost to start a match.
Config.defaultPlayPrice = {
    amount = 50, -- Set 0 or nil to make it free
    currency = "money", -- "money" or an item ID (e.g. "token")
    onlyApplyToDefaultTables = true -- Only charge at tables spawned through Config.tables, so for example the one in your housing system can be free
}

-- 🏢 Business Integration
-- Optional system to route income to an organization (like a job or society).
-- Each table can be owned by a business, requiring an employee nearby to play.
Config.business = {
    enabled = false, -- Enable or disable business integration
    recipientShare = 1.0, -- % of price that goes to the organization (0.0 - 1.0)
    requiresEmployeeNearby = true, -- Require an employee from that job nearby to play
    employeeRadius = 50.0, -- Distance to check for employees
}

Config.allowPayWithBank = true -- Allow players to pay with bank if they lack cash

🎨 Store Customization

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

-- 🛒 Store NPC Setup
-- Each entry defines a vendor who sells customization items.
Config.stores = {
    {
        model = "cs_lifeinvad_01", -- Ped model
        position = vector3(-1082.769287, -251.301102, 44.006592),
        heading = 257.952759
    }
}

-- 🛍️ Store Items (Customization)
-- Balanced for RP economy with ordered rarity progression. Currency is an item name
Config.store = {
    team_color = {
        red = { cost = 400, currency = "money" },
        blue = { cost = 400, currency = "money" },
        green = { cost = 400, currency = "money" },
        yellow = { cost = 400, currency = "money" },
        orange = { cost = 500, currency = "money" },
        skyblue = { cost = 500, currency = "money" },

        purple = { cost = 3500, currency = "money" },
        pink = { cost = 3500, currency = "money" },
        navy = { cost = 4000, currency = "money" },
        maroon = { cost = 4000, currency = "money" },
        black = { cost = 5000, currency = "money" },
        white = { cost = 5000, currency = "money" }
    },

    hat = {
        child = { cost = 1000, currency = "money" },
        irish = { cost = 1500, currency = "money" },
        miner = { cost = 2000, currency = "money" },
        winter = { cost = 2500, currency = "money" },

        monk = { cost = 3000, currency = "money" },
        gentleman = { cost = 4000, currency = "money" },
        pirate = { cost = 5000, currency = "money" },
        viking = { cost = 6000, currency = "money" },

        pope = { cost = 8000, currency = "money" },
        crown = { cost = 9000, currency = "money" },
        wizzard = { cost = 10000, currency = "money" }
    }
}

🧑‍💻 Game Win Event

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


-- Event
AddEventHandler('sverse_table_football:onGameWin', function(data)
    -- data table structure:
    -- data.prop         : string, model or identifier of the foosball table used
    -- data.coords       : vector3, position where the match was played
    -- data.rotation     : vector3, table rotation
    -- data.bucket       : integer, routing bucket (dimension) where the match occurred
    -- data.winner       : string, winning team ("red" or "blue")
    -- data.host         : string, starting side ("red" or "blue")
    -- data.teams        : table containing both teams' info:
    --   ├─ data.teams.red.score      : integer, red team’s final score
    --   ├─ data.teams.red.players    : table, list of red team player IDs
    --   ├─ data.teams.red.skin       : table, skin data for red team
    --   ├─ data.teams.blue.score     : integer, blue team’s final score
    --   ├─ data.teams.blue.players   : table, list of blue team player IDs
    --   └─ data.teams.blue.skin      : table, skin data for blue team

    print("Foosball match ended!")
    print("Table prop: " .. tostring(data.prop))
    print(string.format("Location: %s | Rotation: %s | Bucket: %s", data.coords, data.rotation, data.bucket))
    print("Winning team: " .. tostring(data.winner))
    print("Host side: " .. tostring(data.host))

    print(("Red Team - Score: %s | Players: %s"):format(data.teams.red.score, table.concat(data.teams.red.players, ", ")))
    print(("Blue Team - Score: %s | Players: %s"):format(data.teams.blue.score, table.concat(data.teams.blue.players, ", ")))

    print("Red Team Skin:")
    print(json.encode(data.teams.red.skin, { indent = true }))
    print("Blue Team Skin:")
    print(json.encode(data.teams.blue.skin, { indent = true }))
end)

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