Garry's Mod Wiki

table.RemoveByValue

  any table.RemoveByValue( table tbl, any val )

Description

Removes the first instance of a given value from the specified table with table.remove, then returns the key that the value was found at.

Avoid usage of this function. It does not remove all instances of given value in the table, only the first found, and it does not work with non sequential tables!

Arguments

1 table tbl
The table that will be searched.
2 any val
The value to find within the table.

Returns

1 any
The key at which the value was found, or false if the value was not found.