ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getKeyBoundToFunction

Function

getKeyBoundToFunction

Server and clientInput and controlsIdentical to MTA:SA

Returns the first key a function is bound to.

Syntax

Server

string getKeyBoundToFunction(player thePlayer, function handler)

Client

string getKeyBoundToFunction(function handler)

Arguments

thePlayerplayer
The player (server only).
handlerfunction
The function.

Returns

The key or false.

Example

local function toggleMenu() end
bindKey("F4", "down", toggleMenu)
outputChatBox("Menu: " .. tostring(getKeyBoundToFunction(toggleMenu)))

See also