{"id":"cocacolarocks19/spectatingsystem","name":"spectatingsystem","scope":"cocacolarocks19","platform":"roblox","description":"Mirrored from the Wally registry.","version":"0.0.1","latest":"0.0.1","versions":["0.0.1"],"license":"MIT","licenseRating":"safe","licenseCaveats":["The package archive does not include its license text; the license is declared in its manifest metadata."],"licenseVerified":false,"dependencies":{},"integrity":"77566b633eab5eca5ad55493a436248798747ea24fef42316abcb04875d0ca69","likes":0,"downloads":0,"install":"forest install cocacolarocks19/spectatingsystem","url":"https://forest.dev/p/roblox/cocacolarocks19/spectatingsystem","files":"https://api.forest.dev/ai/package/roblox/cocacolarocks19/spectatingsystem/files","readme":"# SpectatingSystem\n\n## Setup\n\nPlace this package somewhere both server and client can require, such as `ReplicatedStorage`. Require it from a server `Script` and start the server module:\n\n```luau\nlocal SpectatingSystem = require(game.ReplicatedStorage.SpectatingSystem)\nSpectatingSystem.server.start()\n```\n\nFrom a `LocalScript`, require the same package. The client module exposes camera controls for your own UI:\n\n```luau\nlocal SpectatingSystem = require(game.ReplicatedStorage.SpectatingSystem)\nlocal spectating = SpectatingSystem.client\n\nspectating.start()\n-- Connect these to buttons or key bindings:\nspectating.next()\nspectating.previous()\nspectating.stop()\n```\n\n`spectating.isActive(true)` starts spectating, `spectating.isActive(false)` stops it, and `spectating.isActive()` reads the current state. If a `ScreenGui` named `SpectatingGui` is under the local player's `PlayerGui`, the client automatically connects `Container.Next.Hitbox` and `Container.Previous.Hitbox` and updates the `Container.PlayerName` text label. `Hitbox` can be a `GuiButton` or another `GuiObject`.\n\n`start()` returns false when no other player has a living character. `getTarget()` returns the currently watched `Player`, and `isActive()` reports whether spectating is on. The server creates its RemoteEvent when `server.start()` runs. Players are allowed by default; set `Config.AllowByDefault` to false to deny everyone by default, then call `server.setPlayerEnabled(player, true)` for permitted players. Calling `server.stop()` disconnects no event connections; it is intended for one-time server startup/shutdown workflows.\n\nThe client module changes `workspace.CurrentCamera` only while spectating and restores the local character's Humanoid when stopped. It sorts targets by UserId for stable next/previous cycling.\n","readmeTruncated":false}