NetPlayer
This is the server-side class for NetPlayer. It has all the same methods and properties as the shared class, plus the following on this page.
Player Class Hierarchy
The diagram shows the inheritance hierarchy of player-related classes. To navigate between classes:
- Get a
PlayerClient
- Get the
NetPlayer
from aPlayerClient
using:GetNetPlayer()
Class Instance Methods
Inherited Methods
From NetObjectBase
:
NetObjectBase:GetPosition(): vec3
Returns the position of the object.
NetObjectBase:GetRotation(): vec3
Returns the rotation of the object.
NetObjectBase:GetHealth(): number
Returns the current health of the object.
NetObjectBase:GetMaxHealth(): number
Returns the maximum health of the object.
NetObjectBase:GetVelocity(): vec3
Returns the velocity of the object.
NetObjectBase:GetNetId(): number
Returns the network ID of the object.
Class Methods
NetPlayer:GiveWeapon(string name, int ammo, bool equip, WeaponSlot slot)
Gives a weapon to the player with specified ammo count and optional equipping. View the full list of weapons here.
NetPlayer:RemoveWeapon(WeaponSlot slot)
Removes a weapon from the specified weapon slot.