M MY Multiplayer: Wiki
Side
Kind

getKeyBoundToCommand

Client

Tells which key runs a command on this client.

string|false getKeyBoundToCommand(string command)

Parameters

NameTypeDescription
commandstringThe command's name.

Returns

The name of the first key found, or false if no key runs the command.

It looks through the command binds of every client resource.

Example

bindKey("F3", "down", "radio")

local key = getKeyBoundToCommand("radio")
if key then
    outputDebugString("Press " .. key .. " to open the radio")
end

See also