Exports

Les exports d'oxb pour vos ressources : bannir, expulser, débannir, captures, enregistrements, score de menace, temps de jeu et bypass.

Cette page n'est pas encore traduite dans votre langue : la version anglaise est affichée.


You can use oxb from your scripts. The server exports are the most common; the client ones are few and the script marking ones are in Exceptions and compatibility.

Server exports#

ExportWhat it does
banPlayer(source, reason, details?, duration?)Bans a connected player. reason is the reason; duration in seconds (without a value, it uses the duration of Settings).
kickPlayer(source, reason, details?, duration?)Kicks a connected player.
unbanPlayer(banId)Removes a ban by its ID.
unbanAllPlayers(from?)Removes all the bans.
getBanInfo(banId)Returns exists, data of the ban.
screenshot(source, webhook)Takes a screenshot of the player and sends it to the webhook.
captureLastSeconds(source, webhook)Records the last seconds of the player's game and sends them to the webhook.
getThreatScore(playerId)The threat score of the player (0 to 100).
getPlayTime(playerId)The time played by the player.
hasBypass(playerId)true if the player has the BYPASS permission.
Server
-- ban from your own system
exports.oxb:banPlayer(source, "Abuse of the economy system", { item = "money" }, 86400)
 
-- do not let in whoever carries too much risk
AddEventHandler("playerConnecting", function(name, setKickReason, deferrals)
local src = source
local score = exports.oxb:getThreatScore(src)
if score and score > 80 then
setKickReason("Your account has a risky history.")
CancelEvent()
end
end)
 
-- is it part of the test team?
if exports.oxb:hasBypass(source) then return end

Client exports#

ExportWhat it does
banPlayer(message, details?, duration?)Bans the local player. Use it from a client script of yours.
kickPlayer(message, details?, duration?)Kicks the local player.
isRunning()Tells whether oxb is running on the client.

Dernière mise à jour : 11 novembre 2026