ScriptsAboutBlogToolsKnowledge BaseReviewsFAQBasketDocsSupport
client

IsControlJustReleased

FiveM client native documentation with a Lua example.

Summary

Returns true on the single frame a control (key/button) is released. The standard way to detect a keypress for interactions and menus.

Returns

boolean

Parameters

inputGroupnumberUsually 0 (player control group).
controlnumberThe control ID (e.g. 38 = E).

Example

CreateThread(function()
  while true do
    Wait(0)
    if IsControlJustReleased(0, 38) then -- E
      TriggerEvent('myscript:interact')
    end
  end
end)

Common pitfalls

  • Must be checked every frame (Wait(0)) or you miss the release.
  • Use JustReleased/JustPressed for one-shot actions; IsControlPressed fires continuously.
  • Look up control IDs in the FiveM controls reference rather than guessing.

Related natives

Related guides

FiveM scripts done right

Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.

Browse Scripts →