table.GetWinningKey

From GMod Wiki

Jump to: navigation, search
Function
Syntax table.GetWinningKey( Table table )
Where is this used?
Description:
Returns the key linked to the highest number.
Returns: nil
Part of Library: Table
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Table.GetWinningKey]Table.GetWinningKey [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionThis example will print the key associated with the highest number.
Used onNewerShared.png
Code
local t = {23, 433, 44, 252, 16}
 
print(table.GetWinningKey(t))
Output2


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox