Skip to content

New library: player

dounai2333 edited this page Jan 20, 2025 · 2 revisions

Introduction

The player library is used to get the Lua objects that represent players in-game.

GetAll

dounai_lib.player.GetAll(mode, no_SourceTV)

Gets all the current players in the server (not including connecting clients). If no_SourceTV is true, the Source TV will be ignored.

Available modes:

0: All

1: Alive Players

2: Bots

3: Real Players

Return: table

mode: number

no_SourceTV: bool

GetAllAlives

dounai_lib.player.GetAllAlives()

Gets all the current aliving players on the server.

Return: table

GetBots

dounai_lib.player.GetBots()

Returns a table of all bots on the server.

Return: table

GetHumans

dounai_lib.player.GetHumans()

Returns a table containing all human players (non-bot/AI).

Return: table

Random

dounai_lib.player.Random(alive_only)

Get a random player. If alive_only is true, the only aliving player will be selected.

Return: player

alive_only: bool

Clone this wiki locally