Player Detector¶
Picture
The Player Detector is able to recognize players within a certain range. In addition, it recognizes the player who clicks on him.
Overview¶
Peripheral Name | Interfaces with | Events | Introduced in |
---|---|---|---|
playerDetector | Players | Yes | 0.1b |
Events¶
Event Name | Parameter One | Parameter Two | Description |
---|---|---|---|
playerClick | "playerClick" | string username | Fires when a player clicks on the block. |
Functions¶
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
Function | Returns | Description |
---|---|---|
getPlayerPos(string player) | table | Returns player's position. |
getOnlinePlayers() | table | Returns a table of all online players. |
getPlayersInRange(int range) | table | Return players within a certain range. |
getPlayersInCoords(table posOne, table posTwo) | table | Return players within 2 positions. The tables need to have a x, y, and z value |
getPlayersInCubic(int x, int y, int z) | table | Return players within a certain range. You can define the range in every 3 axes |
isPlayerInRange(int range, string username) | boolean | Returns true if the player is in range, false if not. |
isPlayerInCoords(table posOne, table posTwo) | boolean | Returns true if the player is within 2 positions. The tables need to have a x, y, and z value |
isPlayerInCubic(int x, int y, int z) | boolean | Returns true if the player is within a certain range. You can define the range in every 3 axes |
isPlayersInRange(int range) | boolean | Returns true if any player is in range, false if not. |
isPlayersInCoords(table posOne, table posTwo) | boolean | Returns true if any player is within 2 positions. The tables need to have a x, y, and z value |
isPlayersInCubic(int x, int y, int z) | boolean | Returns true if any player is within a certain range. You can define the range in every 3 axes |
Info
The center of the range is the Player Detector itself and not the Computer.
Changelog/Trivia¶
The player detector was also a buggy block, like the energy detector. But it was not too buggy. We had bugs that the block uses completely wrong coordinates or the range was broken.
0.7.4r
Added more information to the getPlayerPos
function. (Configurable)
0.7r
Added more functions to the player detector. One to define the range in every 3 axes, one to define 2 positions.
Also added getOnlinePlayers
0.4.2b Added a max range config value.
0.3b Added the functions isPlayersInRange and isPlayerinRange.
0.2.6b Added the function getPlayersInRange.
0.1b Added the player detector, it was the third feature of the mod.