M MY Multiplayer: Wiki
Side
Kind

getKeyBoundToFunction

Shared

Tells which key this resource bound a function to.

string|false getKeyBoundToFunction(player thePlayer, function handler)

Parameters

NameTypeDescription
thePlayerplayerServer only: the player the bind belongs to. On the client, leave this argument out.
handlerfunctionThe function to look for.

Returns

The name of the first key found, or false if the function is not bound.

Example

local function openMap()
    outputDebugString("map")
end

bindKey("F11", "down", openMap)
outputDebugString("Map key: " .. tostring(getKeyBoundToFunction(openMap)))

See also