Skip to main content

NetVehicle

This is the server-side class for NetVehicle. It has all the same methods and properties as the shared class, plus the following server-specific methods for vehicle customization.

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.

NetObjectBase:SetData(key: string, value: any): boolean

Sets generic data on the object. Value must be a number, string, bool, vec2, vec3, vec4, or quat. Returns true if the data was set successfully, false otherwise (for unsupported types).

NetObjectBase:GetData(key: string): any

Gets generic data from the object.

NetObjectBase:AsPlayer(): NetPlayer | nil

Returns NetPlayer instance if the object is a player, nil otherwise.

NetObjectBase:AsVehicle(): NetVehicle | nil

Returns NetVehicle instance if the object is a vehicle, nil otherwise.

NetObjectBase:GetType(): NetObjectType

Returns the network object type. Use NetObjectType enum to compare types.

From NetVehicle:

NetVehicle:GetId(): number

Returns the ID of the vehicle.

Class Methods

NetVehicle:SetPrimaryColor(r: number, g: number, b: number): void

Sets the primary color of the vehicle. RGB values should be floats between 0 and 1.

NetVehicle:SetSecondaryColor(r: number, g: number, b: number): void

Sets the secondary color of the vehicle. RGB values should be floats between 0 and 1.

NetVehicle:SetTertiaryColor(r: number, g: number, b: number): void

Sets the tertiary color of the vehicle. RGB values should be floats between 0 and 1.

NetVehicle:SetSpecularGloss(value: number): void

Sets the specular gloss of the vehicle. Value should be a float between 0 and 1.

NetVehicle:SetClearCoat(value: number): void

Sets the clear coat value of the vehicle. Value should be a float between 0 and 1.

NetVehicle:SetMetallic(value: number): void

Sets the metallic value of the vehicle. Value should be a float between 0 and 1.

NetVehicle:SetDirt(value: number): void

Sets the dirt level of the vehicle. Value should be a float between 0 and 1, although higher values can make the vehicle extremely dirty.