Vehicle

https://i.imgur.com/CHBy45q.png

Chad Vehicle

Usage

local veh = Vehicle(
  Vector(0, 0, 0),
  Rotator(0, 0, 0),
  "NanosWorld::BP_Vehicle_SUV"
)

Constructor Parameters

Type

Name

Default

Vector

Location

Vector(0, 0, 0)

Rotator

Rotation

Rotation(0, 0, 0)

string

ModelName

number

CollisionType

0 (Normal)

boolean

GravityEnabled

true

Functions

Returns

Name

Description

server-only-label

Horn(boolean Bool)

Starts or stops the vehicles horn

server-only-label

SetBodyRoughness(number NewBodyRoughness)

Sets the vehicle body roughness. Values between 0 and 1.

server-only-label

SetGlassColor(Color NewGlassColor)

Sets the vehicle glass color

server-only-label

SetGlassOpacity(number NewGlassOpacity)

Sets the vehicle glass opacity. Values between 0 and 1.

server-only-label

SetLightColor(Color NewLightColor)

Sets the vehicle light color

string

GetAssetName()

Gets the Asset name

number

GetBodyRoughness()

Gets the vehicle body roughness

Color

GetGlassColor()

Gets the vehicle glass color

number

GetGlassOpacity()

Gets the vehicle glass opacity

Color

GetLightColor()

Gets the vehicle light color

Character

GetPassenger(number Seat)

Gets all passengers. Returns nil if Seat is invalid or empty.

Character[]

GetPassengers()

Gets all passengers

Functions (Inherited from Pickable)

Returns

Name

Description

server-only-label

AddSkeletalMeshAttached(string ID, string StaticMeshPath)

Spawns and Attaches a SkeletalMesh into this Actor, the SkeletalMesh must have the same Skeletal used by this Actor Mesh, and will follow all animations from it. Uses a custom ID to be used for removing it further

server-only-label

AddStaticMeshAttached(string ID, string StaticMeshPath, string Socket = “”, Vector RelativeLocation = Vector(), Rotator RelativeRotation = Rotator())

Spawns and Attaches a StaticMesh into this Actor in a Socket with relative Location and Rotation. Uses a custom ID to be used for removing it further

server-only-label

PullUse()

Force this Pickable to be used (e.g. if this is a Weapon, will fire)

server-only-label

ReleaseUse()

Force this Pickable to be released the usage

server-only-label

RemoveSkeletalMeshAttached(string ID)

Removes, if existing, a SkeletalMesh from this Actor given it’s custom ID

server-only-label

RemoveStaticMeshAttached(string ID)

Removes, if existing, a StaticMesh from this Actor given it’s custom ID

string

GetAssetName()

Gets the Asset name

Character

GetHandler()

Gets the Character (if existing) which is holding this

Functions (Inherited from Actor)

Returns

Name

Description

server-only-label

AddImpulse(Vector Force)

Applies a Force in world coordinate on this Actor (the force is applied on Client side, by the (in most of cases) the closest player of this object)

server-only-label

AttachTo(Actor Other, string BoneName, Vector RelativeLocation, Rotator RelativeRotation)

Attaches this Actor to any other Actor with a Relative Offset/Rotation

server-only-label

Destroy()

Destroys this Actor

server-only-label

SetCollision(number CollisionType)

Sets the actor’s collision (0 - Normal, 1 - Static Only, 2 - No Collision)

server-only-label

SetGravityEnabled(boolean NewGravity)

Sets the actor’s gravity enabled

client-only-label

SetHighlightEnabled(boolean Enabled)

Sets if this Actors is Highlighting

server-only-label

SetInitialLocation(Vector NewInitialLocation)

Sets the initial location

server-only-label

SetLocation(Vector NewLocation)

Sets the actor’s location in the game world

server-only-label

SetRotation(Rotator NewRotation)

Sets the actor’s rotation in the game world

server-only-label

SetScale(Vector Scale)

Sets the actor’s scale

server-only-label

SetTintColor(Color NewTintColor)

Sets the tint color, for completely paint an object, multiply the color by 10 or 100

SetValue(string Key, any Value)

Sets a value in this entity, which can be accessed by any package (local only)

boolean

IsGravityEnabled()

Gets the actor’s gravity enabled

boolean

IsValid()

Returns if this is Valid

number

GetCollision()

Gets the current actor’s collision

number

GetID()

Gets the network ID of this entity (same in both client and server)

Vector

GetLocation()

Get the actor’s position in the game world

server-only-label

Vector

GetInitialLocation()

Gets the initial location

Rotator

GetRotation()

Gets the actor’s rotation in the game world

Vector

GetScale()

Gets the actor’s scale

Color

GetTintColor()

Gets the Tint Color

string

GetType()

Returns the type of this Actor

any

GetValue(string Key)

Gets a value given a key

Events

Name

Arguments

Description

Horn

Vehicle self, boolean IsHonking

When Vehicle honks

Events (Inherited from Actor)

Name

Arguments

Description

Destroy

Entity actor

Triggered when an Entity is Destroyed

Spawn

Entity actor

Triggered when an Entity is Spawned/Created