• Detecting if a player jumped
    4 replies, posted
Hey guys I am making a stamina system and am trying to detect if a player jumped. I had tried to see if the key is down, but if you hold down space bar my stamina will just drain. I only want it to drain when a successful jump is executed. If anyone can help me please do and thanks! if (client:KeyDown( IN_JUMP )) then if client:getLocalVar("stm", 0) >= 10 then client:setLocalVar("stm", (client:getLocalVar("stm", 0) - 10)) elseif client:getLocalVar("stm", 0) < 10 then client:setLocalVar("stm", 0) end end
Ah ok thanks! Also do you know why the coding format is messed up on Facepunch for me? I see double ends and thenif. It formats oddly :/
I actually just fixed it by doing the "ugly wide screen" mode.
Sorry, you need to Log In to post a reply to this thread.