hello
Créé le : 28 août 2025
Répondu en utilisant GPT-5 Thinking par Chat01
Créé le : 28 août 2025
Répondu en utilisant GPT-5 Thinking par Chat01
hello
hello
hey! 👋 what’s up? how can I help today?
i have probleme in script fivem
Gotcha—FiveM script trouble can be a pain. Here’s a quick, practical checklist plus a tiny working example you can drop in to isolate the issue. If it still breaks, paste your exact error from F8 or the server console and I’ll pinpoint it.
Folder & start-up
resources/[local]/myresource
.server.cfg
: ensure myresource
refresh
then restart myresource
fxmanifest
vector3
, etc.).Client vs server
TriggerServerEvent
is client → serverTriggerClientEvent
is server → client (usually TriggerClientEvent(name, src, ...)
)Dependencies
dependency
in your manifest.Infinite loops
while true do
must include Wait(0)
(or longer), or you’ll lock up.Resource/export names
exports['qb-core']:GetCoreObject()
(resource folder must be exactly qb-core
)Use this to confirm your environment is fine.
fxmanifest.lua
luafx_version 'cerulean' game 'gta5' lua54 'yes' client_scripts {'client.lua'} server_scripts {'server.lua'}
server.lua
lua-- Simple server <-> client ping RegisterNetEvent('hello:ping', function() local src = source TriggerClientEvent('hello:pong', src, ('server sees you: %s (resource %s)'):format(src, GetCurrentResourceName())) end)
client.lua
lua-- /ping in the chat will test the event roundtrip RegisterCommand('ping', function() print('client: sending ping to server...') TriggerServerEvent('hello:ping') end, false) RegisterNetEvent('hello:pong', function(msg) print('client got:', msg) end)
If that works, the issue is in your original script. If it doesn’t, the problem is setup/ordering.
attempt to index a nil value (global 'ESX')
es_extended
before your resource, or add to manifest:
luadependency 'es_extended'
attempt to index a nil value (global 'QBCore')
qb-core
is started, then in your script:
luaQBCore = exports['qb-core']:GetCoreObject()
attempt to call a nil value (global 'MySQL')
/ DB issues
luaserver_scripts {'@oxmysql/lib/MySQL.lua','server.lua'} dependency 'oxmysql'
No such export
fxmanifest
.vector3
nil / native missing
fx_version 'cerulean'
(as above).If you can, paste the exact error lines (from F8 client console or server console) and the relevant snippet—I'll zero in on the fix.