Garry's Mod Wiki

Revision Difference

Player:KeyReleased#527832

<function name="KeyReleased" parent="Player" type="classfunc"> <description>Gets whether a key was just released this tick</description>⤶ <description>Gets whether a key was just released this tick.</description>⤶ <realm>Shared</realm> <args> <arg name="key" type="number">The key, see <page>Enums/IN</page></arg> </args> <rets> <ret name="" type="boolean">Was released or not</ret> </rets> </function> <example> <description>Prints whenever the first player first stops pressing W</description>⤶ <description>Prints whenever the first player first stops pressing <key>+FORWARD</key> key (<key>W</key> on QWERTY keyboards).</description>⤶ <code> hook.Add( "Tick", "CheckPlayer1Forward", function() if Entity( 1 ):KeyReleased( IN_FORWARD ) then print( "Player1 just stopped moving forward!" ) end end ) </code> ⤶ </example></example>