Skip to content

Instantly share code, notes, and snippets.

@hobione2k
Last active March 22, 2024 09:22
Show Gist options
  • Save hobione2k/1298af84a6a7f86ff49fbca5e3d0e6a5 to your computer and use it in GitHub Desktop.
Save hobione2k/1298af84a6a7f86ff49fbca5e3d0e6a5 to your computer and use it in GitHub Desktop.
ClusterScript ワールドにいるユーザーを一括取得するやつ
const activePlayer = (players) =>
players.filter((p) => p != null && p.exists());
const getAllPlayer = () => {
const players = $.getPlayersNear($.getPosition(), Infinity);
return activePlayer(players);
}
@hobione2k
Copy link
Author

hobione2k commented Mar 1, 2024

使い方

const players = getAllPlayer();
const playerCount = players.length;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment