Codectionary / Developer documentation / Luau

UnreliableRemoteEvent

Send non-critical, frequent messages without guaranteed delivery or ordering.

Why use UnreliableRemoteEvent?

UnreliableRemoteEvent can suit transient effects or position hints where the next update supersedes an old one. Messages may be dropped or arrive out of order, so never use it for purchases, inventory, or other essential state.

Try it in Roblox Studio

Create a UnreliableRemoteEvent named AimHint in ReplicatedStorage. Put the first Script in ServerScriptService and the second LocalScript in StarterPlayerScripts; test with a Studio client.

Syntax

remote:FireServer(value)
remote.OnServerEvent:Connect(function(player, value) ... end)

Examples

UnreliableRemoteEvent

Server receiver for an optional aim hint.

local remote = game:GetService("ReplicatedStorage"):WaitForChild("AimHint")
assert(remote:IsA("UnreliableRemoteEvent"))
remote.OnServerEvent:Connect(function(player, direction)
    if typeof(direction) ~= "Vector3" then
        return
    end
    print(player.Name, "aim hint:", direction)
end)
  1. OnServerEvent receives the actual sending Player plus the client-supplied direction.
  2. The typeof check prevents the example from treating arbitrary client data as a Vector3.
  3. Even a valid vector is only a hint, not proof of a hit or permission to affect gameplay.

Client sender

LocalScript in StarterPlayerScripts; send a non-critical direction sample.

local remote = game:GetService("ReplicatedStorage"):WaitForChild("AimHint")
assert(remote:IsA("UnreliableRemoteEvent"))
remote:FireServer(Vector3.new(0, 0, -1))
  1. FireServer sends a value toward the server, but delivery is not guaranteed.
  2. The server receives the Player as the first OnServerEvent argument; clients cannot choose that identity.
  3. A single aim hint is disposable. Use a reliable RemoteEvent for actions that must arrive.

Best practices

  • Use reliable remotes for critical state changes.
  • Validate all client-supplied values on the server.

Runtime & versions

Luau host; Roblox engine examples require Roblox Studio. Feature availability depends on the language and runtime version used by your project; consult the official reference below.

Luau documentation

Specifications & further reading