{"id":"gigahd/foreachplayer","name":"foreachplayer","scope":"gigahd","platform":"roblox","description":"Mirrored from the Wally registry.","version":"0.1.0","latest":"0.1.0","versions":["0.1.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"c9b55d3c6e457458d2e34b7135216ba968fc7aa14d77b85d17219c6a1908d1fe","likes":0,"downloads":0,"install":"forest install gigahd/foreachplayer","url":"https://forest.dev/p/roblox/gigahd/foreachplayer","files":"https://api.forest.dev/ai/package/roblox/gigahd/foreachplayer/files","readme":"# ForEachPlayer\nRun callbacks for every player, present and future.\n\n## Installation\nAdd it to your `wally.toml`:\n\n```toml\n[dependencies]\nForEachPlayer = \"giga/foreachplayer@0.1.0\"\n```\n\n## Usage\n```luau\nlocal ForEachPlayer = require(path.to.ForEachPlayer)\n\nlocal disconnect = ForEachPlayer(function(player)\n    print(`{player.Name} is in the game`)\nend, function(player, reason)\n    print(`{player.Name} left: {reason}`)\nend)\n\n-- Stop all future callbacks\ndisconnect()\n```\n\nBoth callbacks are optional. `onPlayerAdded` also runs for players already in the game.\n\nOn the server, `onPlayerRemoving` also runs for each remaining player when the game closes, with an `Enum.CloseReason` instead of an `Enum.PlayerExitReason`. Shutdown waits for those calls to finish.\n","readmeTruncated":false}