Documentation
R_FFA

r_ffa Exports

Client and server exports for r_ffa: check whether a player is in an arena, read their lobby or game mode, and count players per lobby.

Client exports

isInFFA

Returns whether the local player is currently inside an arena (FFA lobby or duel).

local inArena = exports.r_ffa:isInFFA()
ReturnsDescription
booleantrue while the player is in a lobby

GetGameMode

local mode = exports.r_ffa:GetGameMode()
ReturnsDescription
'ffa'In a public or custom lobby
'1v1'In a wager duel
nilNot in an arena

GetSession

Returns the full session table or nil.

local session = exports.r_ffa:GetSession()
-- session.lobbyId, session.kind ('public' | 'custom' | 'duel'), session.label,
-- session.arena (arena key), session.weapons, session.armor, session.kills, session.deaths, session.streak

Server exports

GetTotalPlayerCount

local total = exports.r_ffa:GetTotalPlayerCount()

Number of players across every lobby and duel.

GetLobbyPlayerCount

local count = exports.r_ffa:GetLobbyPlayerCount('paleto_pistols')

Players in one lobby by its id (public lobbies use the id from R.Lobbies).

IsPlayerInFFA

local inArena = exports.r_ffa:IsPlayerInFFA(source)

GetPlayerLobby

local lobby = exports.r_ffa:GetPlayerLobby(source)
-- { id = 'custom_3', kind = 'custom', label = 'Pistols only', arena = 'paleto', players = 6 } or nil

Need help?

Common Issues

Check the troubleshooting guide