Event

network:peer:leave

Server

Fired when a peer disconnects from the server

Signal

"network:peer:leave"

Arguments

TypeNameDescription
intpeer_idId of the peer that left

This signal is only fired on the server.

  • Use it to clean up any state you keep per peer.

Example

Clean up after a leaving peer
local players = {}

util.event.on("network:peer:leave", function(peer_id)
    players[peer_id] = nil
end)

On this page