Documentation
R_Tophud

r_tophud Exports

Hide or show r_tophud from your own scripts with client exports, for shops, cameras or cutscenes, without changing the player's own toggle.

Both exports are client-side. They let another resource hide the HUD temporarily, for example while a shop, a camera scene or a cutscene is open, without touching the player's own toggle state (/togglehud).

setVisible

exports.r_tophud:setVisible(false) -- hide the HUD
exports.r_tophud:setVisible(true)  -- show it again

Hiding is a separate layer on top of the player's toggle: if the player has the HUD turned off themselves, setVisible(true) does not force it on. When it becomes visible again the HUD refreshes immediately.

isVisible

local visible = exports.r_tophud:isVisible()

Returns true when the HUD is currently shown. The player has it on and no script has hidden it.

Wrap the calls in pcall if your resource should also run on servers without R_Tophud:

pcall(function() exports.r_tophud:setVisible(false) end)