player.GetBots
From GMod Wiki
Revision as of 11:46, 20 February 2010 by Scorpius289 (Talk | contribs)
Function | |
Syntax |
player.GetBots( ) Where is this used? |
Description: | |
Returns a table of all the connected bots as Player objects. | |
Returns: | Table :Player |
Part of Library: | Player |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Player.GetBots]Player.GetBots [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | This example grabs all the player objects, and prints out each name. |
---|---|
Used on | |
Code | for k, v in pairs(player.GetBots()) do Msg( v:Nick() .. "\n") end |
Output | N/A |
Additional Notes
- Don't use a variable called "player" as this will mess this up. Overwriting a default table is bad.
- If called client-side, this function will return an empty table