WorldPlayer

A player in the game.  The Server has a world player for each connection including themselves, a client only has a world player for themselves.  A client’s view of another client is a regular game object.

Summary
WorldPlayerA player in the game.
Functions
NKGetBiomeWeightsReturns a table containing biome IDs and weights for this player The table is formatted as follows: { biomeID = biomeWeight }
NKGetAveragePingServer: Gets the average ping of the player over the last 8 pings.
NKGetLastPingServer: Gets the last ping of the player.
NKGetPawnGets the game object used for this player
NKIsLocalPlayerCheck if this is a local player
NKIsRemotePlayerCheck if this is a remote player
NKTeleportToRespawnTeleport back to the previously set respawn location
NKGetPhiGet the Phi angle of the player
NKGetThetaGet the Theta angle of the player
NKGetSpeedGet the current set speed of the player
NKIsJumpingFlag if the player is jumping or not
NKTeleportToLocationTeleport the player to the given location
NKSetRespawnLocationSet the respawn location of the player
NKGetRespawnLocationGet the respawn location of the player
NKSetLoginLocationSet the location the player needs to go to login too
NKGetPlayerNameGet the chosen name of the player

Functions

NKGetBiomeWeights

Returns a table containing biome IDs and weights for this player The table is formatted as follows: { biomeID = biomeWeight }

Returns

TableTable containing up to 3 entires, the keys of which are biome IDs and the values, weights.

NKGetAveragePing

Server: Gets the average ping of the player over the last 8 pings.  A server’s own player will always show 0 Client: Returns their last 8 average pings to the server

Returns

intthe last 8 average pings in milliseconds.  Updated every 2 seconds

NKGetLastPing

Server: Gets the last ping of the player.  A server’s own player will always show 0 Client: Returns their last ping to the server

Returns

intthe last ping in milliseconds.  Updated every 2 seconds

NKGetPawn

Gets the game object used for this player

Returns

GameObjectthe game object representing this player.  Nil if no pawn has been created yet

NKIsLocalPlayer

Check if this is a local player

Returns

booltrue if this is the local player on the machine (a server or client’s own player)

NKIsRemotePlayer

Check if this is a remote player

Returns

booltrue if this is the remote player on the machine

NKTeleportToRespawn

Teleport back to the previously set respawn location

NKGetPhi

Get the Phi angle of the player

Returns

floatthe phi angle of the player in degrees

NKGetTheta

Get the Theta angle of the player

Returns

floatthe theta angle of the player in degrees

NKGetSpeed

Get the current set speed of the player

Returns

floatthe set speed of the player

NKIsJumping

Flag if the player is jumping or not

Returns

booltrue if the player is jumping, false if not

NKTeleportToLocation

Teleport the player to the given location

Parameters

vec3the position to teleport the player to

NKSetRespawnLocation

Set the respawn location of the player

Parameters

vec3the new respawn location for the player

NKGetRespawnLocation

Get the respawn location of the player

Returns

vec3the respawn location for the player

NKSetLoginLocation

Set the location the player needs to go to login too

Parameters

vec3the login location for the player

NKGetPlayerName

Get the chosen name of the player

Returns

stringthe player’s name
Close