swag_k_dog Posted December 24, 2016 Share Posted December 24, 2016 local state = 0 addEventHandler("onClientKey", root, function(button, press) if state == 0 and button == "x" then showCursor(true) state = state + 1 elseif state == 1 then showCursor(false) state = state - 1 end end ) when I press X to show my cursor it appears for like 0.5 seconds and then it dissapears. also, if I hold X the cursor appears without dissapearing. make it normal? ty Link to comment
pa3ck Posted December 24, 2016 Share Posted December 24, 2016 bindKey("x", "down", function() showCursor(not isCursorShowing()) end) Link to comment
Bonsai Posted December 24, 2016 Share Posted December 24, 2016 Isn't it obvious why that happens? You press the button, the cursor shows, you release the button, the cursor disappears. You need to check if the button is pressed or released. 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