ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. getPlayersByData

Function

getPlayersByData

ServerPlayersTrilogy Hub only

Returns the players whose data value under a key equals the given one.

Syntax

table getPlayersByData(string key, mixed value)

Arguments

keystring
The data key.
valuemixed
The value to match.

Returns

A table of players.

Example

for _, cop in ipairs(getPlayersByData("job", "police")) do
    outputChatBox("Napad na bank!", cop, 255, 0, 0)
end