{"id":"stackyzdev/remote","name":"remote","scope":"stackyzdev","platform":"roblox","description":"Mirrored from the Wally registry.","version":"0.1.1","latest":"0.1.1","versions":["0.1.0","0.1.1"],"license":"MIT","licenseRating":"safe","licenseCaveats":["License identified from the packaged LICENSE file; the manifest declared none."],"licenseVerified":true,"dependencies":{},"integrity":"26ed2744d3e279be221a73d9f8c6a70ee3a533caa2c3647abe8a88d59b0e643d","likes":0,"downloads":0,"install":"forest install stackyzdev/remote","url":"https://forest.dev/p/roblox/stackyzdev/remote","files":"https://api.forest.dev/ai/package/roblox/stackyzdev/remote/files","readme":"# Remote\n\nA lightweight, type-safe utility module for working with RemoteFunctions and RemoteEvents in Roblox. Simplifies server-client communication with a clean API and full Luau type support.\n\n## Installation\n\nAdd to your `wally.toml`:\n\n```toml\n[dependencies]\nRemote = \"stackyzdev/remote@0.1.0\"\n```\n\nThen run:\n\n```bash\nwally install\n```\n\n## API\n\n```lua\nlocal Remote = require(path.to.Remote)\n```\n\n### `Remote.Function<T..., U...>(name: string, parent: Instance?): Function<T..., U...>`\n\nCreates or retrieves a `RemoteFunction` with the given name.\n\n### `Remote.Event<T...>(name: string, parent: Instance?): Event<T...>`\n\nCreates or retrieves a `RemoteEvent` with the given name.\n\n### `Remote.Unreliable<T...>(name: string, parent: Instance?): Event<T...>`\n\nCreates or retrieves an `UnreliableRemoteEvent` with the given name.\n\n> If no `parent` is provided, it defaults to the module's script instance. On the server, instances are created automatically; on the client, the module waits for them to replicate.\n\n## Usage\n\n### RemoteEvent\n\n```lua\nlocal Remote = require(path.to.Remote)\n\nlocal myEvent = Remote.Event(\"MyEvent\")\n\n-- Server\nmyEvent.OnServerEvent:Connect(function(player, message)\n    print(player.Name, message)\nend)\n\n-- Client\nmyEvent:FireServer(\"Hello from client!\")\n```\n\n### RemoteFunction\n\n```lua\nlocal Remote = require(path.to.Remote)\n\nlocal myFunction = Remote.Function(\"MyFunction\")\n\n-- Server\nmyFunction:OnServerInvoke(function(player, arg1)\n    return \"Got: \" .. tostring(arg1)\nend)\n\n-- Client\nlocal result = myFunction:InvokeServer(\"ping\")\nprint(result) -- \"Got: ping\"\n```\n\n### UnreliableRemoteEvent\n\n```lua\nlocal Remote = require(path.to.Remote)\n\nlocal positionUpdate = Remote.Unreliable(\"PositionUpdate\")\n\n-- Server\npositionUpdate:FireAllClients(Vector3.new(0, 10, 0))\n```\n\n## Creating a Networking Package\n\nBecause every remote is fully typed, you can define all your game's remotes in a single shared module, acting as a central, type-safe networking layer that both server and client scripts import.\n\n```lua\n-- ReplicatedStorage/Network.luau\nlocal Remote = require(path.to.Remote)\n\nlocal Network = {\n    -- Events\n    PlayerDamaged = Remote.Event(\"PlayerDamaged\") :: Remote.Event<number>,\n    ChatMessage = Remote.Event(\"ChatMessage\") :: Remote.Event<string, string>,\n    ItemPickedUp = Remote.Event(\"ItemPickedUp\") :: Remote.Event<string, number>,\n    \n    -- Unreliable (high-frequency, loss-tolerant)\n    PositionSync = Remote.Unreliable(\"PositionSync\") :: Remote.Event<Vector3, Vector3>,\n    \n    -- Functions\n    GetInventory = Remote.Function(\"GetInventory\") :: Remote.Function<(), { [string]: number }>,\n    PurchaseItem = Remote.Function(\"PurchaseItem\") :: Remote.Function<(string, number), boolean>,\n}\n\nreturn Network\n```\n\nThen use it anywhere with full autocomplete and type checking:\n\n```lua\n-- Server Script\nlocal Network = require(ReplicatedStorage.Network)\n\nNetwork.PlayerDamaged.OnServerEvent:Connect(function(player, damage)\n    -- `player` is Player, `damage` is number ✓\nend)\n\nNetwork.GetInventory:OnServerInvoke(function(player)\n    -- must return { [string]: number } ✓\n    return { Sword = 1, Shield = 2 }\nend)\n```\n\n```lua\n-- Client Script\nlocal Network = require(ReplicatedStorage.Network)\n\nNetwork.ChatMessage:FireServer(\"general\", \"Hello!\")        -- (string, string) ✓\nNetwork.PositionSync.OnClientEvent:Connect(function(pos, vel)\n    -- `pos` and `vel` are Vector3 ✓\nend)\n\nlocal inventory = Network.GetInventory:InvokeServer()      -- returns { [string]: number } ✓\n```\n\nThis pattern gives you a single source of truth for every remote in your game, with full type safety across the server-client boundary.\n\n## Types\n\nThe module exports the following types for use in typed Luau code:\n\n| Type | Description |\n|------|-------------|\n| `Remote.ServerSignal<T...>` | Server-side event signal (includes `Connect`, `ConnectParallel`, `Once`, `Wait`) |\n| `Remote.ClientSignal<T...>` | Client-side event signal |\n| `Remote.Function<T..., U...>` | Typed RemoteFunction with `InvokeServer` and `OnServerInvoke` |\n| `Remote.Event<T...>` | Typed RemoteEvent with `FireServer`, `FireClient`, `FireAllClients`, and signal properties |\n","readmeTruncated":false}