SkatCh Posted June 19, 2014 Share Posted June 19, 2014 hi guys please can any one fix this for me . i want when the player press F11 = close Hud , and if he press it again = Hud open . i tried this i am new scripter but it dosen't work it just close the Hud . Note : i create My own Hud it's not GTA Hud so "showPlayerHudComponent" it will never work , addEventHandler( "onClientKey", root, function(button,press) if button == "F11" then removeEventHandler("onClientHUDRender", getRootElement(), HudOpening) else addEventHandler("onClientHUDRender", getRootElement(), HudOpening) end end ) Link to comment
Max+ Posted June 19, 2014 Share Posted June 19, 2014 Try Using another , Key addEventHandler( "onClientKey", root, function(button,press) if button == "F11" then removeEventHandler("onClientHUDRender", root, HudOpening) elseif button == "F10" then addEventHandler ( "onClientHUDRender", root, HudOpening ) end end ) --ClientSide , Link to comment
SkatCh Posted June 19, 2014 Author Share Posted June 19, 2014 no i want it with F11 (open, close) with the same key . Link to comment
Castillo Posted June 19, 2014 Share Posted June 19, 2014 local state = false bindKey ( "F11", "down", function ( ) state = ( not state ) if ( state ) then addEventHandler ( "onClientHUDRender", getRootElement(), HudOpening ) else removeEventHandler ( "onClientHUDRender", getRootElement(), HudOpening ) end end ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now