Bitfighter  021
The Bitfighter Lua Documentation - Robots, Levelgens, and Plugins
PlayerInfo Class Reference

Contains information about a specific player.

Member Functions

getName()
 
getRating()
 
getScore()
 
getScriptName()
 
getShip()
 
getTeamIndex()
 
isRobot()
 

Detailed Description

Contains information about a specific player.

The PlayerInfo object contains data about each player, including both humans and robots.

-- Monitor all spawning ships, and if they're a bot, relocate them to 200,200.
function onShipSpawned(ship)
playerInfo = ship:getPlayerInfo()
if playerInfo:isRobot() then
ship.setPos(200, 200)
end

Member Function Documentation

◆ getName()

returns string
Returns
The player's game-unique username (e.g. ChumpChange or S_bot.0).

◆ getRating()

returns num
Returns
The player's rating a shown on the scoreboard.

◆ getScore()

returns int
Returns
The number of points this player has scored this game.

◆ getScriptName()

returns string
Returns
The filename of the script (e.g. s_bot.bot)

◆ getShip()

returns Ship
Returns
The player's ship, or nil if the player is "dead".

◆ getTeamIndex()

returns int
Returns
The index of the player's team.

◆ isRobot()

returns bool
Returns
true if the player is a Robot, false otherwise