👩💻 Player
Players are Entities that represents the individual behind the mouse and keyboard. Players are spawned automatically when connected to the server
🟥 You cannot spawn or Destroy Players.
🎒 Examples
-- Spawns and possess a Character when a Player joins the server
Player.Subscribe("Spawn", function(player)
local new_char = Character(Vector(), Rotator(), "nanos-world::SK_Male")
player:Possess(new_char)
end)
-- Destroys the Character when the Player leaves the server
Player.Subscribe("Destroy", function(player)
local character = player:GetControlledCharacter()
if (character) then
character:Destroy()
end
end)
🗿 Static Functions
| Account | ||
GetBySteamID: Player or nil | Retrieves a player by their Steam ID | |
Inherited static functions
Subscribe, UnsubscribeSubscribeRemoteGetAll, GetByIndex, GetCount, GetPairsAccountstatic functions

GetBySteamIDSlow
Retrieves a player by their Steam ID
local player = Player.GetBySteamID(steam_id)
Parameters
| Name | Type | Descrição |
|---|---|---|
steam_id | string | The Steam ID (SteamID64) to look for |
🦠 Functions
| Account | ||
GetAccountIconURL: string | Return a URL which can be used through WebUI and Widgets to display the Player's Steam Avatar (64x64) | |
GetAccountID: string | Gets the Player's nanos world account ID | |
GetAccountName: string | Gets the Player's nanos world account name | |
GetName: string | Gets the Player's name | |
GetSteamID: string | Gets the Player's Steam ID | |
SetName | Sets the player's name | |
| Audio | ||
GetVOIPAmplitude: float | Returns how loud this player is talking right now | |
GetVOIPGlobalHighPassFilter: integer | Returns the global VOIP high-pass filter threshold frequency | |
GetVOIPGlobalLowPassFilter: integer | Returns the global VOIP low-pass filter threshold frequency | |
GetVOIPGlobalVolume: float | Returns the global VOIP volume | |
GetVOIPListeningChannels: table of integer | Returns a list of VOIP channels this player is listening to | |
GetVOIPLocalAttenuation: integer, AttenuationFunction | Returns how the local/proximity VOIP fades with distance | |
GetVOIPLocalHighPassFilter: integer | Returns the local/proximity VOIP high-pass filter threshold frequency | |
GetVOIPLocalLowPassFilter: integer | Returns the local/proximity VOIP low-pass filter threshold frequency | |
GetVOIPLocalMaxDistance: integer | Returns the local/proximity VOIP max distance | |
GetVOIPLocalOcclusion: boolean, integer, float | Returns the automatic occlusion settings of the local/proximity VOIP | |
GetVOIPLocalVolume: float | Returns the local/proximity VOIP volume | |
GetVOIPSpeakingChannels: table of integer | Returns a list of VOIP channels this player is currently speaking to | |
IsVOIPMuted: boolean | Returns whether VOIP is muted for this player | |
SetVOIPGlobalAllChannelsSetting | Sets the VOIP setting for all global channels | |
SetVOIPGlobalChannelSetting | Sets the VOIP setting for a specific global channel | |
SetVOIPGlobalHighPassFilter | Sets the global VOIP high-pass filter threshold frequency | |
SetVOIPGlobalLowPassFilter | Sets the global VOIP low-pass filter threshold frequency | |
SetVOIPGlobalVolume | Sets the global VOIP volume. It only affects the global channels | |
SetVOIPLocalAttenuation | Sets how the local/proximity VOIP fades with distance | |
SetVOIPLocalHighPassFilter | Sets the local/proximity VOIP high-pass filter threshold frequency | |
SetVOIPLocalLowPassFilter | Sets the local/proximity VOIP low-pass filter threshold frequency | |
SetVOIPLocalMaxDistance | Sets the local/proximity VOIP max distance. This also affects networking usage | |
SetVOIPLocalOcclusion | Configures the automatic occlusion of the local/proximity VOIP | |
SetVOIPLocalSetting | Sets the VOIP setting for the local/proximity | |
SetVOIPLocalVolume | Sets the local/proximity VOIP input/output volume. It only affects the local/proximity channel | |
SetVOIPMuted | Mutes or unmutes VOIP for this player | |
| Camera | ||
AttachCameraTo | Attaches the Player's Camera to an Actor | |
GetCameraArmLength: float | Gets the Player's camera arm (spring arm) length | |
GetCameraLocation: Vector | Gets the location of the Player's camera | |
GetCameraRotation: Rotator | Gets the rotation of the Player's camera | |
ResetCamera | Resets the Camera to default state (Unspectate and Detaches) | |
RotateCameraTo | Smoothly moves the Player's Camera Rotation | |
SetCameraArmLength | Sets the Player's Camera Arm Length (Spring Arm length) | |
SetCameraFOV | Sets the Player's Camera FOV (if not possessing a Character) | |
SetCameraLocation | Sets the Player's Camera Location (only works if not possessing any Character) | |
SetCameraRotation | Sets the Player's Camera Rotation | |
SetCameraSocketOffset | Sets the Player's Camera Socket Offset (Spring Arm Offset) | |
SetCameraSpeedSettings | Sets the Player's Camera Speed Settings (if not possessing a Character) | |
SetManualCameraFade | Turns on camera fading at the given opacity | |
StartCameraFade | Does a camera fade to/from a solid color | |
StopCameraFade | Stops camera fading | |
TranslateCameraTo | Smoothly moves the Player's Camera Location (only works if not possessing any Character) | |
| Control | ||
GetControlledCharacter: Base Pawn or nil | Gets the Pawn (Character) this Player is currently possessing | |
Possess | Makes this Player possess and control a Pawn (Character) | |
Spectate | Makes this Player spectate another Player | |
UnPossess | Release the Player from the Character | |
| Network | ||
Ban | Bans the player from the server | |
Connect | Redirects the player to another server | |
GetDimension: integer | Gets this Player's dimension | |
GetIP: string | Gets the Player's IP address | |
GetPing: integer | Gets the Player's ping | |
IsHost: boolean | Gets if this Player is the host of a P2P (listen) server | |
IsLocalPlayer: boolean | Gets if this Player is the local Player (the one running this client) | |
Kick | Kicks the player from the server | |
SetDimension | Sets this Player's dimension | |
SetDistanceOptimizationMultiplier | Sets the multiplier for how much this Player's is affected by distance optimization from other actors | |
Inherited functions
GetAllValuesKeys, GetValue, SetValueSubscribe, UnsubscribeDestroy, FinishSpawn, IsBeingDestroyed, IsSpawned, IsValid, SetSpawnModeBroadcastRemoteEvent, BroadcastRemoteInRadiusEvent, CallRemoteEvent, CallRemoteEvent, CallRemotePlayersEvent, HasAuthority, SubscribeRemoteGetIDAccountfunctions

GetAccountIconURLOptimal
Return a URL which can be used through WebUI and Widgets to display the Player's Steam Avatar (64x64)
local account_icon_url = my_player:GetAccountIconURL()
Returns
| Type | Descrição |
|---|---|
| string | URL of the Steam avatar image |

GetAccountIDOptimal
Gets the Player's nanos world account ID
local account_id = my_player:GetAccountID()
Returns
| Type | Descrição |
|---|---|
| string | The nanos world account ID |

GetAccountNameOptimal
Gets the Player's nanos world account name
local account_name = my_player:GetAccountName()
Returns
| Type | Descrição |
|---|---|
| string | The account name |

GetNameOptimal
Gets the Player's name
local player_name = my_player:GetName()
Returns
| Type | Descrição |
|---|---|
| string | The Player's name |
See also SetName.

GetSteamIDOptimal
Gets the Player's Steam ID
local steam_id = my_player:GetSteamID()
Returns
| Type | Descrição |
|---|---|
| string | The Steam ID (SteamID64) |

SetNameOptimal
Sets the player's name
my_player:SetName(player_name)
Parameters
| Name | Type | Descrição |
|---|---|---|
player_name | string | The new player's name |
See also GetName.
Audiofunctions

GetVOIPAmplitudeModerate
Returns how loud this player is talking right now
It is the RMS of the last voice data received from this player, before distance attenuation, occlusion and filters. Normal speech stays low in the scale, usually between 0.05 and 0.3. It only works for players the local player is receiving voice from, and for the local player while the voice is being transmitted. The local player's voice is only measured while this method keeps being called, so the first call returns 0
local ret = my_player:GetVOIPAmplitude()
Returns
| Type | Descrição |
|---|---|
| float | The voice amplitude from 0 to 1, or 0 if the player is not talking |
See also VOIP.

GetVOIPGlobalHighPassFilterOptimal
Returns the global VOIP high-pass filter threshold frequency
local ret = my_player:GetVOIPGlobalHighPassFilter()
Returns
| Type | Descrição |
|---|---|
| integer | The threshold frequency in Hz, 0 if disabled |
See also SetVOIPGlobalHighPassFilter.

GetVOIPGlobalLowPassFilterOptimal
Returns the global VOIP low-pass filter threshold frequency
local ret = my_player:GetVOIPGlobalLowPassFilter()
Returns
| Type | Descrição |
|---|---|
| integer | The threshold frequency in Hz, 0 if disabled |
See also SetVOIPGlobalLowPassFilter.

GetVOIPGlobalVolumeOptimal
Returns the global VOIP volume
local ret = my_player:GetVOIPGlobalVolume()
Returns
| Type | Descrição |
|---|---|
| float | The global VOIP volume |
See also SetVOIPGlobalVolume.

GetVOIPListeningChannelsModerate
Returns a list of VOIP channels this player is listening to
local ret = my_player:GetVOIPListeningChannels()

GetVOIPLocalAttenuationOptimal
Returns how the local/proximity VOIP fades with distance
local inner_radius, falloff_function = my_player:GetVOIPLocalAttenuation()
Returns
| Type | Descrição |
|---|---|
| integer | The inner radius, where the voice plays at full volume |
| AttenuationFunction | How the volume fades between the inner radius and the max distance |
See also SetVOIPLocalAttenuation.

GetVOIPLocalHighPassFilterOptimal
Returns the local/proximity VOIP high-pass filter threshold frequency
local ret = my_player:GetVOIPLocalHighPassFilter()
Returns
| Type | Descrição |
|---|---|
| integer | The threshold frequency in Hz, 0 if disabled |
See also SetVOIPLocalHighPassFilter.

GetVOIPLocalLowPassFilterOptimal
Returns the local/proximity VOIP low-pass filter threshold frequency
local ret = my_player:GetVOIPLocalLowPassFilter()
Returns
| Type | Descrição |
|---|---|
| integer | The threshold frequency in Hz, 0 if disabled |
See also SetVOIPLocalLowPassFilter.

GetVOIPLocalMaxDistanceOptimal
Returns the local/proximity VOIP max distance
local ret = my_player:GetVOIPLocalMaxDistance()
Returns
| Type | Descrição |
|---|---|
| integer | The local/proximity VOIP max distance |
See also SetVOIPLocalMaxDistance.

GetVOIPLocalOcclusionOptimal
Returns the automatic occlusion settings of the local/proximity VOIP
local enabled, low_pass_frequency, volume_multiplier = my_player:GetVOIPLocalOcclusion()
Returns
| Type | Descrição |
|---|---|
| boolean | If the voice is automatically occluded |
| integer | The low-pass filter threshold frequency applied when occluded, in Hz |
| float | The volume multiplier applied when occluded |
See also SetVOIPLocalOcclusion.

GetVOIPLocalVolumeOptimal
Returns the local/proximity VOIP volume
local ret = my_player:GetVOIPLocalVolume()
Returns
| Type | Descrição |
|---|---|
| float | The local/proximity VOIP volume |
See also SetVOIPLocalVolume.

GetVOIPSpeakingChannelsModerate
Returns a list of VOIP channels this player is currently speaking to
local ret = my_player:GetVOIPSpeakingChannels()

IsVOIPMutedOptimal
Returns whether VOIP is muted for this player
local ret = my_player:IsVOIPMuted()
Returns
| Type | Descrição |
|---|---|
| boolean | Whether VOIP is muted for this player |
See also SetVOIPMuted.

SetVOIPGlobalAllChannelsSettingOptimal
Sets the VOIP setting for all global channels
my_player:SetVOIPGlobalAllChannelsSetting(setting)
Parameters
| Name | Type | Descrição |
|---|---|---|
setting | VOIPSetting | The new VOIP setting for all global channels |
See also SetVOIPGlobalChannelSetting, GetVOIPListeningChannels, GetVOIPSpeakingChannels, VOIPGlobalChannelSettingChange.

SetVOIPGlobalChannelSettingOptimal
Sets the VOIP setting for a specific global channel
my_player:SetVOIPGlobalChannelSetting(channel, setting)
Parameters
| Name | Type | Descrição |
|---|---|---|
channel | integer | Channel number, from 1 to 63 |
setting | VOIPSetting | Whether this Player listens, speaks, both or none on this channel |
See also SetVOIPGlobalAllChannelsSetting, GetVOIPListeningChannels, GetVOIPSpeakingChannels, VOIPGlobalChannelSettingChange.

SetVOIPGlobalHighPassFilterOptimal
Sets the global VOIP high-pass filter threshold frequency
Set it to 0 to disable it
my_player:SetVOIPGlobalHighPassFilter(threshold)
Parameters
| Name | Type | Descrição |
|---|---|---|
threshold | integer | The new global VOIP high-pass filter threshold frequency |
See also SetVOIPGlobalLowPassFilter, GetVOIPGlobalHighPassFilter.

SetVOIPGlobalLowPassFilterOptimal
Sets the global VOIP low-pass filter threshold frequency
Set it to 0 to disable it
my_player:SetVOIPGlobalLowPassFilter(threshold)
Parameters
| Name | Type | Descrição |
|---|---|---|
threshold | integer | The new global VOIP low-pass filter threshold frequency |
See also SetVOIPGlobalHighPassFilter, GetVOIPGlobalLowPassFilter.

SetVOIPGlobalVolumeOptimal
Sets the global VOIP volume. It only affects the global channels
my_player:SetVOIPGlobalVolume(volume)
Parameters
| Name | Type | Descrição |
|---|---|---|
volume | float | The new global VOIP volume. It only affects the global channels |
See also GetVOIPGlobalVolume.

SetVOIPLocalAttenuationModerate
Sets how the local/proximity VOIP fades with distance
The voice plays at full volume inside the inner radius, then fades to silence at the max distance set with SetVOIPLocalMaxDistance
my_player:SetVOIPLocalAttenuation(inner_radius, falloff_function?)
Parameters
| Name | Type | Descrição |
|---|---|---|
inner_radius | integer | Distance where the voice plays at full volume. Default is 800. It is clamped to the max distance |
falloff_function? | AttenuationFunction | How the volume fades between the inner radius and the max distance Default AttenuationFunction.Logarithmic |
See also SetVOIPLocalMaxDistance, GetVOIPLocalAttenuation.

SetVOIPLocalHighPassFilterModerate
Sets the local/proximity VOIP high-pass filter threshold frequency
Set it to 0 to disable it. On server side, it applies to everyone hearing this player. On client side, it only applies to the local listener
my_player:SetVOIPLocalHighPassFilter(threshold)
Parameters
| Name | Type | Descrição |
|---|---|---|
threshold | integer | The new local/proximity VOIP high-pass filter threshold frequency, in Hz |
See also SetVOIPLocalLowPassFilter, SetVOIPLocalOcclusion, GetVOIPLocalHighPassFilter.

SetVOIPLocalLowPassFilterModerate
Sets the local/proximity VOIP low-pass filter threshold frequency
Set it to 0 to disable it. Useful to muffle a voice, like a player behind a wall, inside a vehicle or wearing a mask. On server side, it applies to everyone hearing this player. On client side, it only applies to the local listener
my_player:SetVOIPLocalLowPassFilter(threshold)
Parameters
| Name | Type | Descrição |
|---|---|---|
threshold | integer | The new local/proximity VOIP low-pass filter threshold frequency, in Hz |
See also SetVOIPLocalHighPassFilter, SetVOIPLocalOcclusion, GetVOIPLocalLowPassFilter.

SetVOIPLocalMaxDistanceOptimal
Sets the local/proximity VOIP max distance. This also affects networking usage
my_player:SetVOIPLocalMaxDistance(max_distance)
Parameters
| Name | Type | Descrição |
|---|---|---|
max_distance | integer | Falloff Distance. Default is 3600 |
See also SetVOIPLocalSetting, SetVOIPLocalVolume, SetVOIPLocalAttenuation, GetVOIPLocalMaxDistance.

SetVOIPLocalOcclusionModerate
Configures the automatic occlusion of the local/proximity VOIP
When something blocks the line between the listener and this player, the voice gets a low-pass filter and a volume multiplier. It is enabled by default. Disable it to control the muffling from a script, with SetVOIPLocalLowPassFilter and SetVOIPLocalVolume
my_player:SetVOIPLocalOcclusion(enabled, low_pass_frequency?, volume_multiplier?)
Parameters
| Name | Type | Descrição |
|---|---|---|
enabled | boolean | If the voice is automatically occluded |
low_pass_frequency? | integer | The low-pass filter threshold frequency applied when occluded, in Hz Default 3500 |
volume_multiplier? | float | The volume multiplier applied when occluded Default 0.85 |
See also SetVOIPLocalLowPassFilter, SetVOIPLocalVolume, GetVOIPLocalOcclusion.

SetVOIPLocalSettingOptimal
Sets the VOIP setting for the local/proximity
my_player:SetVOIPLocalSetting(setting)
Parameters
| Name | Type | Descrição |
|---|---|---|
setting | VOIPSetting | The new VOIP setting for the local/proximity |
See also SetVOIPLocalMaxDistance, SetVOIPLocalVolume, VOIPLocalSettingChange.

SetVOIPLocalVolumeOptimal
Sets the local/proximity VOIP input/output volume. It only affects the local/proximity channel
my_player:SetVOIPLocalVolume(volume)
Parameters
| Name | Type | Descrição |
|---|---|---|
volume | float | The new local/proximity VOIP input/output volume. It only affects the local/proximity channel |
See also SetVOIPLocalSetting, SetVOIPLocalMaxDistance, GetVOIPLocalVolume, VOIPLocalSettingChange.

SetVOIPMutedOptimal
Mutes or unmutes VOIP for this player
On server side, the player is muted for everyone. On client side, it is a local mute only
my_player:SetVOIPMuted(is_muted)
Parameters
| Name | Type | Descrição |
|---|---|---|
is_muted | boolean | Whether VOIP is muted |
See also IsVOIPMuted.
Camerafunctions

AttachCameraToOptimal
Attaches the Player's Camera to an Actor
my_player:AttachCameraTo(actor, socket_offset?, blend_speed?)
Parameters
| Name | Type | Descrição |
|---|---|---|
actor | Base Actor | The Actor to attach the camera to |
socket_offset? | Vector | Offset of the camera relative to the Actor Default Vector(0, 0, 0) |
blend_speed? | float | Speed of the camera blend, 0 to snap immediately Default 0.0 |

GetCameraArmLengthOptimal
Gets the Player's camera arm (spring arm) length
local length = my_player:GetCameraArmLength(return_base?)
Parameters
| Name | Type | Descrição |
|---|---|---|
return_base? | boolean | Whether to return the current (false) or base (true) value. The base is the same value set by SetCameraArmLength(). Use base if you want to get the original value set by SetCameraArmLength() and not the current (interpolated) value Default false |
Returns
| Type | Descrição |
|---|---|
| float | The camera arm length, in units |
See also SetCameraArmLength.

GetCameraLocationOptimal
Gets the location of the Player's camera
local location = my_player:GetCameraLocation()
Returns
| Type | Descrição |
|---|---|
| Vector | The camera location |
See also SetCameraLocation.

GetCameraRotationOptimal
Gets the rotation of the Player's camera
local rotation = my_player:GetCameraRotation()
Returns
| Type | Descrição |
|---|---|
| Rotator | The camera rotation |
See also SetCameraRotation.

ResetCameraOptimal
Resets the Camera to default state (Unspectate and Detaches)
my_player:ResetCamera()

RotateCameraToOptimal
Smoothly moves the Player's Camera Rotation
my_player:RotateCameraTo(rotation, time, exp?)

SetCameraArmLengthOptimal
Sets the Player's Camera Arm Length (Spring Arm length)
my_player:SetCameraArmLength(length, force?)
Parameters
| Name | Type | Descrição |
|---|---|---|
length | float | Length of the camera spring arm, in units |
force? | boolean | Whether to bypass interpolation and set the target to its value directly Default false |
See also GetCameraArmLength.

SetCameraFOVOptimal
Sets the Player's Camera FOV (if not possessing a Character)
my_player:SetCameraFOV(fov?)
Parameters
| Name | Type | Descrição |
|---|---|---|
fov? | float | Value must be between 5 and 170. Pass empty to reset to default Default 90 |

SetCameraLocationOptimal
Sets the Player's Camera Location (only works if not possessing any Character)
my_player:SetCameraLocation(location)
Parameters
| Name | Type | Descrição |
|---|---|---|
location | Vector | The new Player's Camera Location |
See also GetCameraLocation.

SetCameraRotationOptimal
Sets the Player's Camera Rotation
my_player:SetCameraRotation(rotation)
Parameters
| Name | Type | Descrição |
|---|---|---|
rotation | Rotator | The new Player's Camera Rotation |
See also GetCameraRotation.

SetCameraSocketOffsetOptimal
Sets the Player's Camera Socket Offset (Spring Arm Offset)
my_player:SetCameraSocketOffset(socket_offset)
Parameters
| Name | Type | Descrição |
|---|---|---|
socket_offset | Vector | The new Player's Camera Socket Offset |

SetCameraSpeedSettingsOptimal
Sets the Player's Camera Speed Settings (if not possessing a Character)
my_player:SetCameraSpeedSettings(max_speed?, acceleration?, deceleration?, turning_boost?)
Parameters
| Name | Type | Descrição |
|---|---|---|
max_speed? | float | Maximum velocity magnitude allowed Default 1200 |
acceleration? | float | Acceleration applied by input (rate of change of velocity) Default 4000 |
deceleration? | float | Deceleration applied when there is no input (rate of change of velocity) Default 4000 |
turning_boost? | float | Setting affecting extra force applied when changing direction, making turns have less drift and become more responsive. Velocity magnitude is not allowed to increase, that only happens due to normal acceleration. It may decrease with large direction changes. Larger values apply extra force to reach the target direction more quickly, while a zero value disables any extra turn force Default 8 |

SetManualCameraFadeOptimal
Turns on camera fading at the given opacity
Does not auto-animate, allowing user to animate themselves. Call StopCameraFade to turn fading back off
my_player:SetManualCameraFade(in_fade_amount, color, in_fade_audio)

StartCameraFadeModerate
Does a camera fade to/from a solid color
Animates automatically
my_player:StartCameraFade(from_alpha, to_alpha, duration, to_color, should_fade_audio?, hold_when_finished?)
Parameters
| Name | Type | Descrição |
|---|---|---|
from_alpha | float | Alpha at which to begin the fade. Range [0..1], where 0 is fully transparent and 1 is fully opaque solid color |
to_alpha | float | Alpha at which to finish the fade |
duration | float | How long the fade should take, in seconds |
to_color | Color | Color to fade to/from |
should_fade_audio? | boolean | True to fade audio volume along with the alpha of the solid color Default false |
hold_when_finished? | boolean | True for fade to hold at the ToAlpha until explicitly stopped (e.g. with StopCameraFade) Default false |

TranslateCameraToOptimal
Smoothly moves the Player's Camera Location (only works if not possessing any Character)
my_player:TranslateCameraTo(location, time, exp?)
Controlfunctions

GetControlledCharacterOptimal
Gets the Pawn (Character) this Player is currently possessing
local controlled_character = my_player:GetControlledCharacter()

PossessModerate
Makes this Player possess and control a Pawn (Character)
my_player:Possess(new_pawn, blend_time?, exp?)
Networkfunctions

BanSlow
Bans the player from the server
my_player:Ban(reason)
Parameters
| Name | Type | Descrição |
|---|---|---|
reason | string | The reason shown to the Player |

GetDimensionOptimal
Gets this Player's dimension
local dimension = my_player:GetDimension()
Returns
| Type | Descrição |
|---|---|
| integer | This Player's dimension |
See also SetDimension, DimensionChange.

GetIPOptimal
Gets the Player's IP address
local ip = my_player:GetIP()
Returns
| Type | Descrição |
|---|---|
| string | The IP address |

GetPingOptimal
Gets the Player's ping
local ping = my_player:GetPing()
Returns
| Type | Descrição |
|---|---|
| integer | The ping, in milliseconds |

IsHostOptimal
Gets if this Player is the host of a P2P (listen) server
local is_host = my_player:IsHost()
Returns
| Type | Descrição |
|---|---|
| boolean | Whether this Player is the host |

IsLocalPlayerOptimal
Gets if this Player is the local Player (the one running this client)
local is_local_player = my_player:IsLocalPlayer()
Returns
| Type | Descrição |
|---|---|
| boolean | Whether this is the local Player |

KickModerate
Kicks the player from the server
my_player:Kick(reason)
Parameters
| Name | Type | Descrição |
|---|---|---|
reason | string | The reason shown to the Player |

SetDimensionSlow
Sets this Player's dimension
my_player:SetDimension(dimension)
Parameters
| Name | Type | Descrição |
|---|---|---|
dimension | integer | The new dimension |
See also GetDimension, DimensionChange.

SetDistanceOptimizationMultiplierOptimal
Sets the multiplier for how much this Player's is affected by distance optimization from other actors
A value of 0 disables optimization. Values under 1 decrease the effect, while values over 1 increase it
my_player:SetDistanceOptimizationMultiplier(multiplier)
Parameters
| Name | Type | Descrição |
|---|---|---|
multiplier | float | The new multiplier for how much this Player's is affected by distance optimization from other actors |
🚀 Events
DimensionChange | Triggered when a Player changes its dimension | |
Possess | Triggered when Player starts controlling a Pawn (Character) | |
Ready | Triggered when Player is ready (the client fully joined, loaded the map and all entities and is ready to play) | |
UnPossess | A Pawn (Character) was unpossessed from the Player | |
VOIP | When a Player starts/ends using VOIP | |
VOIPGlobalChannelSettingChange | Triggered when a global VOIP channel setting changes for this player | |
VOIPLocalSettingChange | Triggered when the local VOIP setting changes for this player |
Inherited events
ClassRegister, Destroy, Spawn, ValueChange
DimensionChange
Triggered when a Player changes its dimension
Player.Subscribe("DimensionChange", function(self, old_dimension, new_dimension)
-- DimensionChange was called
end)
Arguments
| Name | Type | Descrição |
|---|---|---|
self | Player | The Player that triggered the event |
old_dimension | integer | The previous dimension |
new_dimension | integer | The new dimension |
See also SetDimension, GetDimension.

Possess
Triggered when Player starts controlling a Pawn (Character)
Player.Subscribe("Possess", function(self, pawn)
-- Possess was called
end)
Arguments
| Name | Type | Descrição |
|---|---|---|
self | Player | The Player that triggered the event |
pawn | Base Pawn | The Pawn being possessed |
See also GetControlledCharacter.

Ready
Triggered when Player is ready (the client fully joined, loaded the map and all entities and is ready to play)
Player.Subscribe("Ready", function(self)
-- Ready was called
end)
Arguments
| Name | Type | Descrição |
|---|---|---|
self | Player | The Player that triggered the event |

UnPossess
A Pawn (Character) was unpossessed from the Player
Player.Subscribe("UnPossess", function(self, pawn)
-- UnPossess was called
end)
Arguments
| Name | Type | Descrição |
|---|---|---|
self | Player | The Player that triggered the event |
pawn | Base Pawn | The Pawn being unpossessed |
See also GetControlledCharacter.

VOIP
When a Player starts/ends using VOIP
Player.Subscribe("VOIP", function(self, is_talking)
-- VOIP was called
return true
end)
Arguments
| Name | Type | Descrição |
|---|---|---|
self | Player | The Player that triggered the event |
is_talking | boolean | Whether the Player started (true) or stopped (false) talking |
Returns
| Type | Descrição |
|---|---|
| boolean | When 'is_talking' is true, return false to prevent this voice stream from playing (on server will prevent for everyone, on client will prevent only for the client) |

VOIPGlobalChannelSettingChange
Triggered when a global VOIP channel setting changes for this player
Player.Subscribe("VOIPGlobalChannelSettingChange", function(self, channel, old_setting, new_setting)
-- VOIPGlobalChannelSettingChange was called
end)
Arguments
| Name | Type | Descrição |
|---|---|---|
self | Player | The Player that triggered the event |
channel | integer | The channel that changed (1-63) |
old_setting | VOIPSetting | The previous setting |
new_setting | VOIPSetting | The new setting |
See also SetVOIPGlobalChannelSetting, SetVOIPGlobalAllChannelsSetting.

VOIPLocalSettingChange
Triggered when the local VOIP setting changes for this player
Player.Subscribe("VOIPLocalSettingChange", function(self, old_setting, new_setting)
-- VOIPLocalSettingChange was called
end)
Arguments
| Name | Type | Descrição |
|---|---|---|
self | Player | The Player that triggered the event |
old_setting | VOIPSetting | The previous setting |
new_setting | VOIPSetting | The new setting |
See also SetVOIPLocalSetting.


