Push → Push Methods

Push Methods

Three server-initiated methods to deliver reliable events to one player, all players, or a subset. The client receives them via the existing Listener with no API changes required.

Signatures

PUSH app:Push(player: Player, event: string, data: any)
PUSH app:PushAll(event: string, data: any)
PUSH app:PushTo(players: {Player}, event: string, data: any)

Parameters

ParameterTypeDescription
playerPlayerTarget player for Push
players{Player}Target subset for PushTo
eventstringEvent name — matched by listener:On(event) on the client
dataanyPayload. Sent over reliable RemoteEvent. No 900-byte cap.

Usage

-- server
app:Push(player, "inventoryUpdate", { item = "sword" })
app:PushAll("roundEnd", { winner = "PlayerA" })
app:PushTo({ p1, p2 }, "zoneAlert", { zoneId = 3 })

-- client | same listener, zero API change
listener:On("inventoryUpdate", function(data) print(data.item) end)
listener:Once("roundEnd", function(data) UI:ShowWinner(data.winner) end)

Round start example

-- Server: fire round.start to all players
local function startRound(roundData)
    app:PushAll("round.start", {
        map      = roundData.map,
        duration = roundData.duration,
    })
end

-- Client: listen for it
local listener = RoExpress("Listener")

listener:On("round.start", function(data)
    showCountdown(data.duration)
    loadMap(data.map)
end)

Port push

Ports expose the same push interface. A push from a port is received by a Listener on the same port name.

-- Server: push from a port
local combatPort = app:GetPort("combat")
combatPort:Push(player, "hit.confirmed", { damage = 50 })

-- Client: listener on the same port name
local combatListener = RoExpress("Listener", "combat")
combatListener:On("hit.confirmed", function(data)
    print("damage:", data.damage)
end)
Internal packet type. Push packets carry type = "push" internally. Listener filters them so Network response packets on the same RemoteEvent are never intercepted.

See also

← Push  ·  Reliability | why Push guarantees delivery  ·  Broadcast | unreliable alternative  ·  Listener | client-side event subscription