diff --git a/client/main.lua b/client/main.lua index 451fbf3..ac294e4 100644 --- a/client/main.lua +++ b/client/main.lua @@ -29,6 +29,14 @@ function HUD:Start(xPlayer) self:Toggle(true) end +local function ToggleHud(state) + HUD:Toggle(state) + HUD.Data.hudHidden = not state +end + +RegisterNetEvent('esx_hud:HudToggle', ToggleHud) +exports('HudToggle', ToggleHud) + -- Handlers -- On script start AddEventHandler("onResourceStart", function(resource)