Libreria di script gratuiti — ESX, QBCore e Standalone

Script FiveM gratuiti
per il tuo server Roleplay

Una libreria in crescita di script Lua puliti, commentati e pronti da incollare per FiveM — etichettati per framework, con dipendenze dichiarate e istruzioni di installazione incluse. ESX Legacy, QBCore e standalone.

Codice validato lato server
Ogni riga commentata

Controlla l'etichetta del framework: ogni script è contrassegnato daESXoQBCoreo standalone. Le dipendenze (ox_lib, oxmysql, qb-target) sono dichiarate in ogni script — assicurati che il server le avvii prima di incollarlo.

La libreria di script

Ogni scheda mostra il framework e la struttura dei file. Tocca uno script per copiarlo all'istante.

Template fxmanifest.lua

UniversaleStarter

La base di ogni risorsa FiveM. Ordine di caricamento corretto, script condivisi e dipendenze dichiarate come consigliato dalla documentazione di FiveM.

Manifest · Universale
fx_version 'cerulean'
game 'gta5'

author 'Your Server Name'
description 'My custom resource'
version '1.0.0'

shared_scripts {
    '@ox_lib/init.lua',
    'config.lua'
}

client_scripts {
    'client.lua'
}

server_scripts {
    '@oxmysql/lib/MySQL.lua',
    'server.lua'
}

lua54 'yes'

Job di mining QBCore (client + server)

QBCoreLavoroQBCore

Un job QBCore completo: estrai minerale in una zona con barra di avanzamento, ricevi un oggetto e vendilo per denaro. Validazione lato server così le ricompense non possono essere falsificate.

Job · QBCore
-- client.lua
local QBCore = exports['qb-core']:GetCoreObject()

local miningZone = nil

CreateThread(function()
    exports['qb-target']:AddTargetModel('prop_rock_4_big2', {
        options = {
            {
                type = 'client',
                event = 'miningjob:client:Mine',
                icon = 'fas fa-hammer',
                label = 'Mine Ore',
                canInteract = function()
                    return not IsPedInAnyVehicle(PlayerPedId(), false)
                end
            }
        },
        distance = 2.5
    })
end)

RegisterNetEvent('miningjob:client:Mine', function()
    if lib.progressCircle({
        duration = 5000,
        label = 'Mining...',
        position = 'bottom',
        canCancel = true,
        disable = { move = true, car = true, combat = true }
    }) then
        TriggerServerEvent('miningjob:server:RewardOre')
    end
end)

-- server.lua
local QBCore = exports['qb-core']:GetCoreObject()

local COOLDOWN = 6 -- seconds between rewards
local lastMine = {}

RegisterNetEvent('miningjob:server:RewardOre', function()
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)
    if not Player then return end

    local now = os.time()
    if lastMine[src] and now - lastMine[src] < COOLDOWN then return end
    lastMine[src] = now

    Player.Functions.AddItem('steel', 1)
    TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items['steel'], 'add')
end)

Shop ESX 24/7 con ox_lib

ESX LegacyNegozioESX

Un semplice shop ESX Legacy: apri un menu su un marker e acquista oggetti con pagamento validato lato server. Funziona con esx_menu o ox_lib.

Shop · ESX Legacy
-- client.lua
ESX = exports['es_extended']:getSharedObject()

local shopItems = {
    { name = 'water',  label = 'Water Bottle', price = 5 },
    { name = 'bread',  label = 'Bread',        price = 8 },
    { name = 'bandage', label = 'Bandage',     price = 15 }
}

CreateThread(function()
    while true do
        local sleep = 1000
        local coords = GetEntityCoords(PlayerPedId())
        local dist = #(coords - vector3(25.7, -1347.3, 29.49))
        if dist < 15 then
            sleep = 0
            if dist < 1.5 then
                ESX.ShowHelpNotification('Press ~INPUT_CONTEXT~ to open the shop')
                if IsControlJustReleased(0, 38) then
                    openShop()
                end
            end
        end
        Wait(sleep)
    end
end)

function openShop()
    local options = {}
    for i, item in ipairs(shopItems) do
        options[i] = {
            title = item.label .. ' - 
#x27; .. item.price, onSelect = function() TriggerServerEvent('shop:server:BuyItem', item.name) end } end lib.registerContext({ id = 'shop_menu', title = '24/7 Shop', options = options }) lib.showContext('shop_menu') end -- server.lua ESX = exports['es_extended']:getSharedObject() local PRICES = { water = 5, bread = 8, bandage = 15 } RegisterNetEvent('shop:server:BuyItem', function(itemName) local src = source local xPlayer = ESX.GetPlayerFromId(src) local price = PRICES[itemName] if not price or not xPlayer then return end if xPlayer.getMoney() >= price then xPlayer.removeMoney(price) xPlayer.addInventoryItem(itemName, 1) TriggerClientEvent('esx:showNotification', src, ('Bought for $%s'):format(price)) else TriggerClientEvent('esx:showNotification', src, 'Not enough money') end end)

Limitatore di velocità del veicolo (QBCore)

QBCore / StandaloneUtilità

Un aiuto alla guida compatibile con lo standalone: attiva un limitatore di velocità da dentro qualsiasi veicolo. Ottimo esempio di stato lato client con un gestore di comandi corretto.

Utility · QBCore / Standalone
-- client.lua
local limiterOn = false
local LIMIT_KMH = 80

RegisterCommand('limiter', function()
    local ped = PlayerPedId()
    if not IsPedInAnyVehicle(ped, false) then
        return lib.notify({ title = 'Get in a vehicle first', type = 'error' })
    end
    limiterOn = not limiterOn
    lib.notify({
        title = limiterOn and ('Limiter ON - ' .. LIMIT_KMH .. ' km/h') or 'Limiter OFF',
        type = limiterOn and 'success' or 'error'
    })

    CreateThread(function()
        while limiterOn and IsPedInAnyVehicle(PlayerPedId(), false) do
            local veh = GetVehiclePedIsIn(PlayerPedId(), false)
            local speed = GetEntitySpeed(veh) * 3.6
            if speed > LIMIT_KMH then
                SetVehicleForwardSpeed(veh, LIMIT_KMH / 3.6)
            end
            Wait(50)
        end
    end)
end, false)

Garage del job ESX (spawn + impound)

ESX LegacyLavoroGarage

Un garage in stile polizia in servizio: genera un veicolo di servizio su un marker e quello precedente viene eliminato per evitare duplicati. Classico pattern ESX.

Job · ESX Legacy
-- client.lua
ESX = exports['es_extended']:getSharedObject()

local GARAGE = vector4(454.6, -1017.4, 28.4, 90.0)
local VEHICLE_MODEL = 'police'
local SPAWN = vector4(438.4, -1018.3, 27.7, 90.0)

CreateThread(function()
    while true do
        local sleep = 1000
        local ped = PlayerPedId()
        local coords = GetEntityCoords(ped)
        if #(coords - GARAGE.xyz) < 20 then
            sleep = 0
            ESX.Game.Utils.DrawText3D(GARAGE.xyz, '[E] Take Vehicle', 0.4)
            if #(coords - GARAGE.xyz) < 2 and IsControlJustReleased(0, 38) then
                local job = ESX.GetPlayerData().job
                if job and job.name == 'police' then
                    ESX.Game.SpawnVehicle(VEHICLE_MODEL, SPAWN.xyz, SPAWN.w, function(vehicle)
                        TaskWarpPedIntoVehicle(ped, vehicle, -1)
                    end)
                else
                    ESX.ShowNotification('You are not police')
                end
            end
        end
        Wait(sleep)
    end
end)

Webhook di log Discord

UniversaleAdminLog

Invia embed ricchi su Discord per eventi importanti del server: pagamenti, morti, azioni admin. Ogni server FiveM serio ha bisogno di questo pattern.

Server Admin · Universale
-- server.lua
local WEBHOOK_URL = GetConvar('discord_webhook', '')

local function sendDiscordLog(title, description, color)
    if WEBHOOK_URL == '' then return end
    PerformHttpRequest(WEBHOOK_URL, function() end, 'POST', json.encode({
        username = 'Server Logs',
        embeds = {
            {
                title = title,
                description = description,
                color = color or 3447003,
                footer = { text = os.date('%Y-%m-%d %H:%M:%S') }
            }
        }
    }), { ['Content-Type'] = 'application/json' })
end

-- Example: log every player connection
AddEventHandler('playerConnecting', function(name)
    local src = source
    sendDiscordLog(
        'Player Connected',
        ('**%s** joined with ID %d'):format(name, src),
        65280 -- green
    )
end)

-- Example: log a purchase from your shop resource
RegisterNetEvent('shop:server:BuyItem', function(itemName)
    local src = source
    local name = GetPlayerName(src) or 'Unknown'
    sendDiscordLog(
        'Purchase',
        ('%s bought %s'):format(name, itemName),
        16776960 -- yellow
    )
end)

Comando di annuncio del server

UniversaleAdmin

Un annuncio riservato agli admin, inviato a ogni giocatore, con notifica ox_lib e controllo dei permessi ace. Utile template per qualsiasi strumento admin.

Server Admin · Universale
-- server.lua
RegisterCommand('announce', function(source, args)
    if source ~= 0 and not IsPlayerAceAllowed(source, 'announce.use') then
        return TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'No permission.' } })
    end

    local message = table.concat(args, ' ')
    if message == '' then return end

    TriggerClientEvent('chat:addMessage', -1, {
        args = { '^3ANNOUNCEMENT', message }
    })
end, false)

-- client.lua (notifications via ox_lib for a nicer look)
RegisterNetEvent('announce:client:Show', function(message)
    lib.notify({
        title = 'Server Announcement',
        description = message,
        type = 'inform',
        position = 'top',
        duration = 8000
    })
end)

-- Add this to server.cfg:
-- add_ace group.admin announce.use allow
-- add_principal identifier.license:YOUR_LICENSE group.admin

Consumo di carburante semplice

StandaloneVeicoloStarter

Un sistema di carburante leggero e standalone: il carburante scende mentre il motore è acceso, rifornisci a un marker della stazione di servizio. Il primo script di "sistemi" perfetto da cui imparare.

Vehicle · Standalone
-- client.lua
local FUEL_USE_PER_MIN = 1.2 -- units per minute at full throttle
local REFUEL_POINT = vector3(263.9, -342.5, 44.6) -- one gas station

CreateThread(function()
    while true do
        local sleep = 5000
        local ped = PlayerPedId()
        if IsPedInAnyVehicle(ped, false) then
            local veh = GetVehiclePedIsIn(ped, false)
            if GetPedInVehicleSeat(veh, -1) == ped then
                sleep = 1000
                local fuel = GetVehicleFuelLevel(veh)
                local rpm = GetVehicleCurrentRpm(veh)
                if fuel > 0 and rpm > 0.0 then
                    DecalRemoveRupture(veh)
                    SetVehicleFuelLevel(veh, math.max(0.0, fuel - (FUEL_USE_PER_MIN / 60) * (rpm + 0.2)))
                end
            end
        end
        Wait(sleep)
    end
end)

-- Refuel when stopped at the gas station
CreateThread(function()
    while true do
        local sleep = 1000
        local coords = GetEntityCoords(PlayerPedId())
        if #(coords - REFUEL_POINT) < 3 then
            sleep = 0
            if IsControlJustReleased(0, 38) then
                local veh = GetVehiclePedIsIn(PlayerPedId(), false)
                if veh ~= 0 then
                    SetVehicleFuelLevel(veh, 100.0)
                    lib.notify({ title = 'Vehicle refueled', type = 'success' })
                end
            end
        end
        Wait(sleep)
    end
end)

Come installare uno script FiveM

Non hai mai aggiunto una risorsa a un server FiveM? Ecco il processo completo.

01

Crea la risorsa

Crea una nuova cartella nella directory resources del tuo server, per esempio resources/[custom]/my-script, e aggiungi i file dello script indicati su ogni scheda.

02

Dichiara le dipendenze

Copia prima il fxmanifest.lua dalla libreria, poi aggiungi i file client/server. Assicurati che ox_lib, oxmysql o qb-core siano avviati prima della tua risorsa.

03

Ensure e riavvio

Aggiungi 'ensure my-script' in server.cfg dopo le sue dipendenze, poi digita 'refresh' e 'restart my-script' nella console del server. Testa in gioco.

FAQ della libreria di script

Questi script FiveM sono davvero gratuiti?

Sì. Ogni script qui presente è gratuito da usare sul tuo server, senza attribuzione richiesta. Puoi modificarlo come preferisci.

Quale framework dovrebbe usare il mio server, ESX o QBCore?

ESX ha la raccolta più grande di risorse gratuite e una lunga storia di community. QBCore è più recente e con impostazioni predefinite più moderne. Se parti da zero, QBCore è una scelta popolare nel 2026; se vuoi la massima compatibilità con le vecchie risorse, scegli ESX Legacy. Gli script qui presenti coprono entrambi.

Questi script sono sicuri da usare su un server in produzione?

Sì — e a differenza degli script casuali dei forum, ogni pagamento e ricompensa qui è validato lato server, che è lo standard di sicurezza di FiveM. Il solo codice lato client può essere aggirato dai cheater; questi template mostrano il pattern giusto.

Cosa sono ox_lib e oxmysql?

Sono le due librerie FiveM più diffuse: ox_lib fornisce menu moderni, notifiche e barre di avanzamento; oxmysql gestisce le query al database. Sono entrambe gratuite e la maggior parte dei server nel 2026 le usa. Ogni scheda script elenca di cosa ha bisogno.

Lo script che cerco non c'è. Cosa faccio?

Usa il nostro generatore AI di script FiveM. Descrivi il sistema — 'un job di caccia con spawn di animali rari e una licenza richiesta' — e ottieni in pochi secondi una risorsa ESX o QBCore completa, con commenti.

Questi script funzionano su RedM o nella modalità storia di GTA V?

Sono scritti per FiveM (il multiplayer di GTA V). RedM usa un ambiente Lua simile ma native diverse, quindi aspettati di doverli adattare. Non funzionano nel GTA V in singleplayer.

Ti serve un sistema FiveM personalizzato?

Descrivi lo script a parole e la nostra AI scrive la risorsa completa — client, server, config e tutto il resto.

Genera il tuo script personalizzato