Skip to content

OnPlayerTravel

A player is about to leave for another region of the cluster.

Comes for SendPlayerToRegion and an admin’s /travel. Return false to keep them here, or a string to send with them instead of the data the call gave. Anything else lets them go with the data as it is. OnPlayerDisconnect follows in the same tick, before the player’s game hears of the trip, so what it saves is there when they arrive.

function OnPlayerTravel(pid, region, data)
-- ...
end
Parameter Type
pid number the player
region string the region they are going to
data string the data the call gave, "" for none
function OnPlayerTravel(pid, region, data)
if isJailed(pid) then return false end
if isLoggedIn(pid) then return "logged" end
end

SendPlayerToRegion · OnPlayerArrive · GetPlayerArrival · the Regions group of the index