Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 391 Bytes

find_player_by_name.md

File metadata and controls

21 lines (16 loc) · 391 Bytes

Find player by name

  1. Get all players
const AllPlayers = [...world.getPlayers()];
  1. Find player using the find function
const InputName = "JaylyPlays";

AllPlayers.find((player) => player.name === InputName);

Full script:

const InputName = "JaylyPlays";

const AllPlayers = [...world.getPlayers()];
AllPlayers.find((player) => player.name === InputName);