mcpField
F
fivem-basics

fivem-basics

github.com/germanfndezDevelopment19444 installsUpdated 2w ago
Repository

About fivem-basics

FiveM basics is a skill for developers building or debugging FiveM Lua resources. It covers resource structure, manifests, client/server responsibilities, events, exports, validation, and debugging guidance.

Key features

  1. 01Organize resource files and fxmanifest.lua
  2. 02Choose client/server logic boundaries
  3. 03Handle local and networked events
  4. 04Define and call cross-resource exports
  5. 05Validate server-side inputs and state
  6. 06Debug with server and F8 logs

Use cases

  1. 01Creating or editing a FiveM resource
  2. 02Implementing client-server event communication
  3. 03Exposing functions across resources
  4. 04Tracing bugs using server or client logs

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/germanfndez/fiveai-skills --skill fivem-basics

After installing, type/fivem-basicsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

rules/
client-server.md
debugging.md
events.md
exports.md
fxmanifest.md
optimization.md
reference-links.md
structure.md

Details

From the project README

FiveM basics

Resource structure, fxmanifest, client/server split, events, exports and debugging for FiveM Lua.

Activation Contract

Load this skill when the user creates or edits any FiveM resource, fxmanifest.lua, client*.lua or server*.lua, asks how client/server, events or exports work, or reports a bug that needs server vs F8 logs.

Hard Rules

  • Manifest: fx_version 'cerulean' and game 'gta5' (or 'rdr3' / 'common'); every client-served file goes in files.
  • Register networked events with RegisterNetEvent; local-only events use AddEventHandler alone, never RegisterNetEvent.
  • Server handlers read the sender from source; broadcast with TriggerClientEvent(event, -1, ...).
  • GetInvokingResource() is nil for every net event that crosses the network; it is not an authentication check. Validate types, ranges and server-owned state instead.
  • Never handle money or item transactions on the client; validate and apply on the server.
  • No game natives in shared_scripts unless guarded by environment.
  • Use PlayerPedId() not GetPlayerPed(-1); use #(a - b) not GetDistanceBetweenCoords.
  • Prefer local; prefer variable Wait() over fixed Wait(0).
  • Resource names use underscores, no spaces or special characters.

Decision Gates

NeedUse
Client to serverTriggerServerEvent(event, ...)
Server to one / all clientsTriggerClientEvent(event, playerId | -1, ...)
Same side onlyTriggerEvent + AddEventHandler
Data back across the networka callback (ox_lib / framework), not paired events
Single-resource, non-networked calla plain function, not an event
Cross-resource functionexports / server_export in manifest, exports.res:fn()
Bug with clean server consoleask for F8 client logs

Execution Steps

  1. Lay out client/, server/, shared/ and the manifest; read rules/structure.md and rules/fxmanifest.md.
  2. Decide the side for each piece of logic (natives on client, data and validation on server).
  3. Wire communication from Decision Gates; name events resource:side:action.
  4. Validate every server handler argument; add distance and state checks.
  5. Point to https://docs.fivem.net/natives/ for native lookups.

Output Contract

Return the manifest plus runnable Lua split by side, with event names, validation and source handling explicit.

References

  • rules/structure.md — scope, client/server separation, naming.
  • rules/fxmanifest.md — manifest entries, globbing, minimal example.
  • rules/client-server.md — what runs where and how sides communicate.
  • rules/events.md — register, trigger, naming, events vs functions, security.
  • rules/exports.md — defining and consuming exports.
  • rules/debugging.md — server console vs F8 logs.
  • rules/optimization.md — locals, tables, natives, loops, security.
  • rules/reference-links.md — official docs and natives reference.

Upstream docs: https://docs.fivem.net/docs/

Comments

Markdown supported