Skip to main content

PilotObject

The base object that all other objects inherit from.

Methods


CanInstallComponent(componentName) → canInstall

The componentName parameter is a ComponentName. It can also be nil.

The canInstall return is a boolean.


CanUninstallComponent(componentName) → canUninstall

The componentName parameter is a ComponentName. It can also be nil.

The canUninstall return is a boolean.


Click()

Emulates a user clicking on the object, seems dysfunctional in some cases, (i.e., ClickButton components do not get triggered).


GetComponent(componentName) → component

The componentName parameter is a ComponentName.

The component return is a Component. It can also be nil.


GetConfigurables() → configurables

Gets information about the configurables of the object.

The configurables return is a dictionary with keys that are strings and values that are ConfigurableDatas.


GetEvents() → events

Gets information about the events of the object.

The events return is an array of event names. It is a string.


GetMethods() → methods

Gets information about the methods of the object.

The methods return is a dictionary with keys that are strings and values that are MethodDatas.


GetOwnerId() → ownerId

Returns who locked the part if the part is locked, otherwise returns who created the part.

The ownerId return is a number. It can also be nil.


GetShape() → shape

Gets the shape of the part, if the part is a block, it will return nil.

The shape return is a string. It can also be nil.


HasComponent() → hasComponent

The hasComponent return is a boolean.


HasPermission(permission) → hasPermission

Returns a boolean as to whether or not the microcontroller has permission to do the specified action.

The permission parameter is a Permission.

The hasPermission return is a boolean.


IsDestroyed() → isDestroyed

Returns a boolean as to whether or not the object is destroyed.

The isDestroyed return is a boolean.


IsGrounded() → isGrounded

Tells you if the part is grounded, meaning it does it have physics. If it is attached to terrain or an anchor for example, it will be grounded.

The isGrounded return is a boolean.


ListComponents() → components

The components return is a string.


Trigger()

Triggers the object.


GetColor() → color

warning

This method is deprecated. Use PilotObject.Color instead.

Gets the color of the object.

The color return is a Color3.


GetDurability() → durability

warning

This method is deprecated. Use PilotObject.Durability instead.

Gets the maximum (not current) durability of the object.

The durability return is a number.


GetNameOfOwnerAsync() → ownerUsername

warning

This method is deprecated. Use require("player"):GetNameFromUserIdAsync instead.

The ownerUsername return is a string. It can also be nil.


GetSize() → size

warning

This method is deprecated. Use PilotObject.Size instead.

Gets the size of the object.

The size return is a Vector3.


GetTemperature() → temperature

warning

This method is deprecated. Use PilotObject.Temperature instead.

Gets the temperature of the object.

The temperature return is a number.

Properties


Anchored

Whether or not the object is anchored. It is a boolean.


AssemblyCenterOfMass

The center of mass of the object's assembly. It is a Vector3.


AssemblyLinearVelocity

The velocity of the object's assembly. It is a Vector3.


AssemblyMass

The total mass of the object's assembly. It is a number.


CFrame

The current CFrame of the object. It is a CFrame.


ClassName

A string representing the type of the object. It is a string.


Color

The current color of the object. It is a Color3.


CreatedBy

The UserId of the user who created the part. Will be nil if the part was created by a constructor. It is a number?.


Durability

The total durability of the object. It is a number.

-- It can alternatively be calculated like so:
local partdata = require("partdata")
local partInfo = assert(partdata.Parts[part.ClassName], "unknown part")

local baseVolume = partInfo.BaseSize[1] * partInfo.BaseSize[2] * partInfo.BaseSize[3]
local volume = part.Size.X * part.Size.Y * part.Size.Z

local durability = ( volume / baseVolume ) ^ ( 1 / 3 ) * partInfo.BaseDurability

GUID

It is a string.


Health

The health of the object as a percentage (between 0 and 1) of the total durability. It is a number. It ranges between 0 and 1.


Heat

The current heat of the object, this is different from the temperature. It is a number.


Mass

The mass of the object. It is a number.


Material

The current material of the object as an Enum.Material. It is an Enum.Material.


Orientation

The current orientation of the object. It is a Vector3.


PartLocked

The UserId of the user who locked the part. Will be nil if the part is unlocked. It is a number?.


Position

The current position of the object. It is a Vector3.


Size

The current size of the object. It is a Vector3.


Temperature

The current temperature of the object, this is different from the heat. It is a number.

Events


Destroying

Fires when the object is destroyed.