NUI focus is stuck — the player cannot move
A menu closed but kept control of the mouse and keyboard, so the player cannot move or type.
Do this first
The player can rejoin to free themselves. The script needs fixing so it stops happening.
What it means
SetNUIFocus(true, true) hands keyboard and mouse to the browser. Until it is handed back the player cannot move, type in chat or open anything else. A UI that hid itself visually but never released focus leaves the game unplayable with nothing on screen.
What causes it
Ordered by how often it is the answer.
- 1
The close path does not release focus
The UI is hidden with CSS or a state change and
SetNUIFocus(false, false)is never called. - 2
An error before the release
The close handler throws partway, and the release line never runs.
- 3
Two UIs open at once
One closes and releases, the other is still open and re-takes focus — or the reverse, and the one still open has no focus.
- 4
The resource stopped while the UI was open
Restarting a resource does not restore focus by itself.
- 5
Focus taken but the page never appeared
Focus was set before the page loaded and the page then failed. Combined with a blank screen, this is the worst version: invisible and unresponsive.
How to tell which one is yours
Can they still turn the camera? Focus taken with SetNUIFocus(true, true) locks both. If chat opens with T, focus is not held and something else is wrong.
Where to look
Every SetNUIFocus call, and whether each true has a matching false on every exit path.
How to fix it
Release in one place, and make it impossible to skip:
local function closeUi()
SetNUIFocus(false, false)
SendNUIMessage({ action = 'close' })
end
RegisterNUICallback('close', function(_, cb)
closeUi()
cb({})
end)
-- and a safety net
AddEventHandler('onResourceStop', function(res)
if res == GetCurrentResourceName() then SetNUIFocus(false, false) end
end)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