Les joueurs sont des entités qui représentent la personne derrière le clavier et la souris. Les joueurs apparaissent automatiquement lorsqu'ils se connectent au serveur.
👪Inheritance
This class shares methods and events from
Base Entity.
🧑💻API Source
This page is auto-generated! The Functions, Properties and Events described here are defined in our
GitHub's API Repository! Feel free to commit suggestions and changes to the source .json API files!
🟥 Vous ne pouvez pas faire apparaître ou détruire des joueurs.
🎒 Examples
Player.Subscribe("Spawn", function(player)
local new_char = Character(Vector(), Rotator(), "nanos-world::SK_Male")
player:Possess(new_char)
end)
Player.Subscribe("Destroy", function(player)
local character = player:GetControlledCharacter()
if (character) then
character:Destroy()
end
end)
🗿 Static Functions
Inherited Entity Static Functions
This class doesn't have own static functions.
🦠 Functions
Inherited Entity Functions

AttachCameraTo
Attache la caméra du Joueur à un Acteur
my_player:AttachCameraTo(actor, socket_offset?, blend_speed?)
Parameters
| Type | Parameter | Default | Description |
|---|
| Base Actor | actor | Required parameter | No description provided |
| Vector | socket_offset? | Vector(0, 0, 0) | No description provided |
| float | blend_speed? | 0.0 | No description provided |

Ban
Bannit le joueur du serveur
Parameters
| Type | Parameter | Default | Description |
|---|
| string | reason | Required parameter | No description provided |

Connect
Redirige le joueur vers un autre serveur
my_player:Connect(IP, password?)
Parameters
| Type | Parameter | Default | Description |
|---|
| string | IP | Required parameter | No description provided |
| string | password? | | Mot de passe du serveur |

GetAccountIconURL
Renvoie une URL utilisable dans l'interface Web (WebUI) et les widgets pour afficher l'avatar Steam du joueur (64x64)
local account_icon_url = my_player:GetAccountIconURL()
Returns
| Type | Description |
|---|
| string | account_icon_url |

GetAccountID
local account_id = my_player:GetAccountID()
Returns
| Type | Description |
|---|
| string | account_id |

GetAccountName
local account_name = my_player:GetAccountName()
Returns
| Type | Description |
|---|
| string | account_name |

GetCameraArmLength
local length = my_player:GetCameraArmLength(return_base?)
Parameters
| Type | Parameter | Default | Description |
|---|
| boolean | return_base? | false | Indique s'il faut renvoyer la valeur actuelle (false) ou de base (true). La valeur de base correspond à celle définie par SetCameraArmLength(). Utilisez la valeur de base si vous souhaitez obtenir la valeur d'origine définie par SetCameraArmLength() et non la valeur actuelle (interpolée). |
Returns
| Type | Description |
|---|
| float | length |
See also SetCameraArmLength.

GetCameraLocation
local location = my_player:GetCameraLocation()
See also SetCameraLocation.

GetCameraRotation
local rotation = my_player:GetCameraRotation()
See also SetCameraRotation.

GetControlledCharacter
local controlled_character = my_player:GetControlledCharacter()

GetDimension
Récupère la dimension du joueur
local dimension = my_player:GetDimension()
See also SetDimension, DimensionChange.

GetIP
local ip = my_player:GetIP()

GetName
local player_name = my_player:GetName()
Returns
| Type | Description |
|---|
| string | player_name |
See also SetName.

GetPing
local ping = my_player:GetPing()

GetSteamID
local steam_id = my_player:GetSteamID()

GetVOIPListeningChannels
Renvoie la liste des canaux VOIP écoutés par le joueur
local ret = my_player:GetVOIPListeningChannels()

GetVOIPSpeakingChannels
Renvoie la liste des canaux VOIP dans lesquels le joueur parle actuellement
local ret = my_player:GetVOIPSpeakingChannels()

IsHost
local is_host = my_player:IsHost()

IsLocalPlayer
local is_local_player = my_player:IsLocalPlayer()
Returns
| Type | Description |
|---|
| boolean | is_local_player |

IsVOIPMuted
Renvoie si la VOIP est coupée pour ce joueur
local ret = my_player:IsVOIPMuted()
Returns
| Type | Description |
|---|
| boolean | No description provided |
See also SetVOIPMuted.

Kick
Expulse le joueur du serveur
Parameters
| Type | Parameter | Default | Description |
|---|
| string | reason | Required parameter | No description provided |

Possess
Permet à un joueur de posséder et de contrôler un Pawn (Pion/Personnage)
my_player:Possess(new_pawn, blend_time?, exp?)
Parameters
| Type | Parameter | Default | Description |
|---|
| Base Pawn | new_pawn | Required parameter | No description provided |
| float | blend_time? | 0 | No description provided |
| float | exp? | 0 | No description provided |

ResetCamera
Réinitialise la caméra à son état par défaut (arrête le mode spectateur et la détache)

RotateCameraTo
Déplace de manière fluide la rotation de la caméra du joueur
my_player:RotateCameraTo(rotation, time, exp?)
Parameters
| Type | Parameter | Default | Description |
|---|
| Rotator | rotation | Required parameter | No description provided |
| float | time | Required parameter | No description provided |
| float | exp? | 0 | Exponential used to smooth interp, use 0 for linear movement |

SetCameraArmLength
Sets the Player's Camera Arm Length (Spring Arm length)
my_player:SetCameraArmLength(length, force?)
Parameters
| Type | Parameter | Default | Description |
|---|
| float | length | Required parameter | No description provided |
| boolean | force? | false | Whether to bypass interpolation and set the target to its value directly |
See also GetCameraArmLength.

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

SetCameraLocation
Sets the Player's Camera Location (only works if not possessing any Character)
my_player:SetCameraLocation(location)
Parameters
| Type | Parameter | Default | Description |
|---|
| Vector | location | Required parameter | No description provided |
See also GetCameraLocation.

SetCameraRotation
Sets the Player's Camera Rotation
my_player:SetCameraRotation(rotation)
Parameters
| Type | Parameter | Default | Description |
|---|
| Rotator | rotation | Required parameter | No description provided |
See also GetCameraRotation.

SetCameraSocketOffset
Sets the Player's Camera Socket Offset (Spring Arm Offset)
my_player:SetCameraSocketOffset(socket_offset)
Parameters
| Type | Parameter | Default | Description |
|---|
| Vector | socket_offset | Required parameter | No description provided |

SetCameraSpeedSettings
Sets the Player's Camera Speed Settings (if not possessing a Character)
my_player:SetCameraSpeedSettings(max_speed?, acceleration?, deceleration?, turning_boost?)
Parameters
| Type | Parameter | Default | Description |
|---|
| float | max_speed? | 1200 | Maximum velocity magnitude allowed |
| float | acceleration? | 4000 | Acceleration applied by input (rate of change of velocity) |
| float | deceleration? | 4000 | Deceleration applied when there is no input (rate of change of velocity) |
| float | turning_boost? | 8 | 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. |

SetDimension
Définit la dimension du joueur
my_player:SetDimension(dimension)
Parameters
| Type | Parameter | Default | Description |
|---|
| integer | dimension | Required parameter | No description provided |
See also GetDimension, DimensionChange.

SetManualCameraFade
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)
Parameters
| Type | Parameter | Default | Description |
|---|
| float | in_fade_amount | Required parameter | Range [0..1], where 0 is fully transparent and 1 is fully opaque solid color. |
| Color | color | Required parameter | No description provided |
| boolean | in_fade_audio | Required parameter | No description provided |

SetName
Sets the player's name
my_player:SetName(player_name)
Parameters
| Type | Parameter | Default | Description |
|---|
| string | player_name | Required parameter | No description provided |
See also GetName.

SetVOIPGlobalAllChannelsSetting
Sets the VOIP setting for all global channels
my_player:SetVOIPGlobalAllChannelsSetting(setting)
Parameters
| Type | Parameter | Default | Description |
|---|
| VOIPSetting | setting | Required parameter | No description provided |
See also SetVOIPGlobalChannelSetting, GetVOIPListeningChannels, GetVOIPSpeakingChannels, VOIPGlobalChannelSettingChange.

SetVOIPGlobalChannelSetting
Sets the VOIP setting for a specific global channel
my_player:SetVOIPGlobalChannelSetting(channel, setting)
Parameters
| Type | Parameter | Default | Description |
|---|
| integer | channel | Required parameter | 0-63 |
| VOIPSetting | setting | Required parameter | No description provided |
See also SetVOIPGlobalAllChannelsSetting, GetVOIPListeningChannels, GetVOIPSpeakingChannels, VOIPGlobalChannelSettingChange.

SetVOIPGlobalHighPassFilter
Sets the global VOIP high-pass filter threshold frequency. Set it to 0 to disable it
my_player:SetVOIPGlobalHighPassFilter(threshold)
Parameters
| Type | Parameter | Default | Description |
|---|
| integer | threshold | Required parameter | No description provided |
See also SetVOIPGlobalLowPassFilter.

SetVOIPGlobalLowPassFilter
Sets the global VOIP low-pass filter threshold frequency. Set it to 0 to disable it
my_player:SetVOIPGlobalLowPassFilter(threshold)
Parameters
| Type | Parameter | Default | Description |
|---|
| integer | threshold | Required parameter | No description provided |
See also SetVOIPGlobalHighPassFilter.

SetVOIPGlobalVolume
Sets the global VOIP volume. It only affects the global channels
my_player:SetVOIPGlobalVolume(volume)
Parameters
| Type | Parameter | Default | Description |
|---|
| float | volume | Required parameter | No description provided |

SetVOIPLocalMaxDistance
Sets the local/proximity VOIP max distance. This also affects networking usage
my_player:SetVOIPLocalMaxDistance(max_distance)
Parameters
| Type | Parameter | Default | Description |
|---|
| integer | max_distance | Required parameter | Falloff Distance. Default is 3600 |
See also SetVOIPLocalSetting, SetVOIPLocalVolume.

SetVOIPLocalSetting
Sets the VOIP setting for the local/proximity
my_player:SetVOIPLocalSetting(setting)
Parameters
| Type | Parameter | Default | Description |
|---|
| VOIPSetting | setting | Required parameter | No description provided |
See also SetVOIPLocalMaxDistance, SetVOIPLocalVolume, VOIPLocalSettingChange.

SetVOIPLocalVolume
Sets the local/proximity VOIP input/output volume. It only affects the local/proximity channel
my_player:SetVOIPLocalVolume(volume)
Parameters
| Type | Parameter | Default | Description |
|---|
| float | volume | Required parameter | No description provided |
See also SetVOIPLocalSetting, SetVOIPLocalMaxDistance, VOIPLocalSettingChange.

SetVOIPMuted
Mutes or unmutes VOIP for this player
my_player:SetVOIPMuted(is_muted)
Parameters
| Type | Parameter | Default | Description |
|---|
| boolean | is_muted | Required parameter | No description provided |
See also IsVOIPMuted.

Spectate
Spectates other Player
my_player:Spectate(player, blend_speed?)
Parameters
| Type | Parameter | Default | Description |
|---|
| Player | player | Required parameter | No description provided |
| float | blend_speed? | 0 | No description provided |

StartCameraFade
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
| Type | Parameter | Default | Description |
|---|
| float | from_alpha | Required parameter | Alpha at which to begin the fade. Range [0..1], where 0 is fully transparent and 1 is fully opaque solid color. |
| float | to_alpha | Required parameter | Alpha at which to finish the fade. |
| float | duration | Required parameter | How long the fade should take, in seconds. |
| Color | to_color | Required parameter | Color to fade to/from. |
| boolean | should_fade_audio? | | True to fade audio volume along with the alpha of the solid color. |
| boolean | hold_when_finished? | | True for fade to hold at the ToAlpha until explicitly stopped (e.g. with StopCameraFade) |

StopCameraFade
Stops camera fading.
my_player:StopCameraFade()

TranslateCameraTo
Smoothly moves the Player's Camera Location (only works if not possessing any Character)
my_player:TranslateCameraTo(location, time, exp?)
Parameters
| Type | Parameter | Default | Description |
|---|
| Vector | location | Required parameter | No description provided |
| float | time | Required parameter | No description provided |
| float | exp? | 0 | Exponential used to smooth interp, use 0 for linear movement |

UnPossess
Release the Player from the Character
🚀 Events
Inherited Entity Events
| Name | Description |
|---|
 | DimensionChange | Triggered when a Player changes it's 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 | Déclenché lorsqu'un joueur commence ou arrête d'utiliser la VOIP |
 | VOIPGlobalChannelSettingChange | Déclenché lorsque le paramètre d'un canal VOIP global change pour ce joueur |
 | VOIPLocalSettingChange | Déclenché lorsque le paramètre de la VOIP locale change pour ce joueur |

DimensionChange
Triggered when a Player changes it's dimension
Player.Subscribe("DimensionChange", function(self, old_dimension, new_dimension)
end)
Arguments
| Type | Argument | Description |
|---|
| Player | self | No description provided |
| integer | old_dimension | No description provided |
| integer | new_dimension | No description provided |
See also SetDimension, GetDimension.

Possess
Triggered when Player starts controlling a Pawn (Character)
Player.Subscribe("Possess", function(self, pawn)
end)
Arguments
| Type | Argument | Description |
|---|
| Player | self | No description provided |
| Base Pawn | pawn | No description provided |
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)
end)
Arguments
| Type | Argument | Description |
|---|
| Player | self | No description provided |

UnPossess
A Pawn (Character) was unpossessed from the Player
Player.Subscribe("UnPossess", function(self, pawn)
end)
Arguments
| Type | Argument | Description |
|---|
| Player | self | No description provided |
| Base Pawn | pawn | No description provided |
See also GetControlledCharacter.

VOIP
Déclenché lorsqu'un joueur commence ou arrête d'utiliser la VOIP
Si is_talking est true, renvoyer false pour bloquer ce flux vocal (bloqué pour tous sur le serveur, uniquement en local sur le client)
Player.Subscribe("VOIP", function(self, is_talking)
return true
end)
Arguments
| Type | Argument | Description |
|---|
| Player | self | No description provided |
| boolean | is_talking | No description provided |

VOIPGlobalChannelSettingChange
Déclenché lorsque le paramètre d'un canal VOIP global change pour ce joueur
Player.Subscribe("VOIPGlobalChannelSettingChange", function(self, channel, old_setting, new_setting)
end)
Arguments
| Type | Argument | Description |
|---|
| Player | self | No description provided |
| integer | channel | No description provided |
| VOIPSetting | old_setting | No description provided |
| VOIPSetting | new_setting | No description provided |
See also SetVOIPGlobalChannelSetting, SetVOIPGlobalAllChannelsSetting.

VOIPLocalSettingChange
Déclenché lorsque le paramètre de la VOIP locale change pour ce joueur
Player.Subscribe("VOIPLocalSettingChange", function(self, old_setting, new_setting)
end)
Arguments
| Type | Argument | Description |
|---|
| Player | self | No description provided |
| VOIPSetting | old_setting | No description provided |
| VOIPSetting | new_setting | No description provided |
See also SetVOIPLocalSetting.