THE ORB
Starting the studio

SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:NNN

This line is FiveM itself saying an error happened somewhere else. It is a signpost, not the problem.

groupsNothing on its ownpersonYou can fix this

Do this first

Copy the WHOLE block, not just this line — the real error is on the next line.

bug_reportPaste your whole console instead

What it means

citizen:/scripting/lua/scheduler.lua is FiveM's own Lua runtime. It is not a file in your resources folder and there is nothing in it to fix. Seeing it at the top of a stack trace means the scheduler caught an error that came from YOUR code and is reporting it from where it was caught.

The real error is further down the same message, usually on the very next line and prefixed with @yourresource/. That is the line to read.

What causes it

Ordered by how often it is the answer.

  1. 1

    An error inside a CreateThread or a SetTimeout

    Anything the scheduler runs on your behalf reports through it. The line number in scheduler.lua changes between FXServer builds and means nothing to you.

  2. 2

    An error inside an event handler

    RegisterNetEvent handlers are invoked by the runtime, so their errors surface the same way.

  3. 3

    An error inside an await

    MySQL.query.await and any Citizen.Await run as coroutines. When the body throws, you get "Error resuming coroutine" followed by the real error.

  4. 4

    An error inside an export

    An export called from another resource that throws reports through the scheduler of the resource that owns it, which is why the resource named in the message is sometimes not the one you were editing.

How to tell which one is yours

Read past the first line. In:

SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:739:
SCRIPT ERROR: @qb-core/server/player.lua:162: attempt to index a nil value (field 'Jobs')

the answer is qb-core/server/player.lua:162, not the scheduler. Paste the WHOLE block rather than the first line — the first line never identifies the problem.

Where to look

The first @resource/file.lua:line in the trace. If there is none, the error came from a native call with no Lua frame, and the resource name in the console channel prefix is your only lead.

How to fix it

There is nothing to change here. Fix the error named below it — this line is a signpost, not the destination.

Still stuck on your own code?

This page is what this error usually means. Paste your console into Server Fixer and it will rank everything in it and tell you what to do first, and if you would rather not touch it, ORBIE can repair the script and hand the resource back ready to drop in.

bug_reportOpen Server Fixer

Errors that travel with this one