getPlayer - EdgeIY/infiniteyield GitHub Wiki

Documentation

table getPlayer(<string> selector, <Player> speaker)

Description

Grabs a list of players based on the inputted string selector or shorthand name. A table is returned by the function containing all the matching player names.

Example

--Note: This is just a snippet
["Function"] = function(args,speaker)
  local players = getPlayer(args[1], speaker) 
  for k,v in pairs(players) do
    print(Players[v].Name)
  end 
end

Additional Notes

This function allows you to use the following selectors:

  • all - includes everyone
  • others - includes everyone except you
  • me - includes your player only
  • #[number] - gets a specified amount of random players
  • random - affects a random player
  • %[team name] - includes everyone on a given team
  • allies / team - players who are on your team
  • enemies / nonteam - players who are not on your team
  • friends - anyone who is friends with you (might not work on someone if ran immediately after you friend them)
  • nonfriends - anyone who is not friends with you
  • guests - guest players (I don't think guests even exist anymore)
  • bacons - anyone with the "bacon" or pal hair
  • age[number] - includes anyone below or at the given age
  • rad[number] - includes anyone within the given radius

It will also find a player via a short version of their name. Example: If you are trying to select mrcoolkid123 you can just type mrcool

⚠️ **GitHub.com Fallback** ⚠️