Part - iimurpyh/pilot-lua GitHub Wiki
The base type for all objects.
Color3 Part:GetColor()
Vector3 Part:GetSize()
void Part:Trigger()
void Part:Configure(dictionary properties)
EventConnection Part:Connect(string Event, function callback)
A string representing the type of the object. Ex:
Port
,Screen
.
A Globally Unique Identifier that represents this part. Mostly for internal use. However, a part's GUID can be used with GetPartFromPort to make a reference to its attached parts.
The part's Position.
The part's CFrame.
Gets the color of the part as a Color3.
Gets the size of the part as a Vector3.
Activates the internal
:Triggered
event of the part. Not all parts tie their trigger signal functionality to this event, so this method should be avoided when possible. TriggerPort can be used to produce actual trigger signals, and you can sometimes avoid signals altogether with other methods like by configuring the SwitchValue of a toggleable part.
Updates the part's configuration options.
Connects to an event on a part. Some parts have special events.
An event which fires when the part is triggered.
An event which fires when the part is configured.
local switch = GetPartFromPort(1, "Switch") --> Get the switch that is connected to the port with ID 1.
switch:Configure({ SwitchValue = true }) --> Enable the switch.
local port1 = GetPort(1) --> Get the Port part with ID 1
local port2 = GetPort(2)
--> When port 1 gets triggered, it triggers port 2.
port1:Connect("Triggered", function()
port2:Trigger()
end)