Player.KeyReleased

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:KeyReleased( Number key )
Description:
Gets whether the key was released. Only works once for each press of the key.
Returns: Boolean
In Object: Player
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.KeyReleased]Player.KeyReleased [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionThis example will output "Forward" in the console every time the player releases the forward key
Used onNewerShared.png
Code
local players = player.GetAll()
for _, player in ipairs( players ) do
   if( player:KeyReleased( IN_FORWARD ) ) then
      Msg( "You released the forward key!\n" )
   end
end
 
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox