Glorpia Docs
Scripting / API

Datatypes

Math, transform and colour values available to Glorpia scripts.

Numeric variables

Datatype constructors accept numeric variables as well as number literals. This applies to Vector2, Vector3, CFrame and Color3 / Colour3 constructors.

Scalar numeric values support inf and -inf. Number properties store floating-point infinity when the property permits it; integer properties map those values to their positive or negative integer limits. Property-specific ranges still apply to bounded properties.

Luau
local x = 12
local y = 5
local z = -3
local red = 88
local green = 255
local blue = 106

local position = Vector3.new(x, y, z)
local colour = Colour3.fromRGB(red, green, blue)

workspace.Part.Position = position
workspace.Part.Colour3 = colour

UDim / UDim2

NameTypeDescription
UDim.new(scale, offset)constructorCreates a one-axis GUI scale/offset value.
UDim.Scale / OffsetnumberThe scale and pixel-offset components.
UDim2.new(xScale, xOffset, yScale, yOffset)constructorCreates a two-axis GUI scale/offset value.
UDim2.X / YUDimHorizontal and vertical dimensions.
UDim2.Width / HeightUDimAliases for X and Y.
Luau
local size = UDim2.new(0, 100, 0, 50)
local radius = UDim.new(0, 8)

workspace.Part.BillboardGui.TextLabel.Size = size
workspace.Part.BillboardGui.TextLabel.UICorner.CornerRadius = radius

Vector2

NameTypeDescription
Vector2.new(x, y)constructorCreates a Vector2.
Vector2.zeroconstant0, 0.
X / YnumberComponents.
Magnitude / UnitpropertyLength and normalised vector.
Dot(other)methodDot product.
+ / -operatorVector addition and subtraction.
* /operatorMultiply or divide by a number.
==operatorComponent equality.

Vector3

NameTypeDescription
Vector3.new(x, y, z)constructorCreates a Vector3.
Vector3.zeroconstant0, 0, 0.
Vector3.xAxis / yAxis / zAxisconstantUnit axes.
X / Y / ZnumberComponents.
Magnitude / UnitpropertyLength and normalised vector.
Dot(other)methodDot product.
Cross(other)methodCross product.
Lerp(goal, alpha)methodInterpolates toward another Vector3 with alpha clamped from 0 to 1.
+ / -operatorVector addition and subtraction.
* /operatorMultiply or divide by a number.
unary -operatorNegates all components.
==operatorComponent equality.

CFrame

NameTypeDescription
CFrame.new(x, y, z)constructorCreates a translation CFrame.
CFrame.Angles(x, y, z)constructorCreates an XYZ rotation CFrame using radians.
CFrame.fromEulerAnglesYXZ(x, y, z)constructorCreates a YXZ-ordered rotation CFrame using X, Y and Z rotation angles in radians.
CFrame.lookAt(position, target)constructorCreates a CFrame pointing from position toward target.
CFrame.identityconstantIdentity transform.
Position / X / Y / ZpropertyPosition values.
LookVector / RightVector / UpVectorVector3Orientation basis vectors.
RotationCFrameRotation-only transform.
Lerp(goal, alpha)methodInterpolates position and rotation toward another CFrame.
Inverse()methodReturns the inverse transform.
PointToWorldSpace(point)methodTransforms a point.
VectorToWorldSpace(vector)methodTransforms a direction vector.
CFrame * CFrameoperatorComposes two transforms.
CFrame * Vector3operatorTransforms a point into world space.
CFrame + Vector3 / CFrame - Vector3operatorOffsets the CFrame position while preserving rotation.

Color3 / Colour3

NameTypeDescription
Color3.new / Colour3.newconstructorCreates a colour using 0 to 1 components.
Color3.fromRGB / Colour3.fromRGBconstructorCreates a colour using 0 to 255 channels.
R / G / Bnumber0 to 1 colour channels.
Lerp(goal, alpha)methodInterpolates toward another Color3 / Colour3 with alpha clamped from 0 to 1.
==operatorCompares colour channels.
Luau
local green = Colour3.fromRGB(88, 255, 106)
workspace.Part.Colour = green

ColourSequence / NumberSequence

NameTypeDescription
ColorSequence.new(start, end) / ColourSequence.new(start, end)constructorCreates the two colour endpoints used by UIGradient.
ColourSequence.Start / EndColour3Read-only endpoint colours.
NumberSequence.new(start, end)constructorCreates two number endpoints. UIGradient transparency values are from 0 through 1.
NumberSequence.Start / EndnumberRead-only endpoint values.
Luau
local colours = ColourSequence.new(
    Colour3.fromRGB(255, 80, 120),
    Colour3.fromRGB(80, 145, 255)
)
local transparency = NumberSequence.new(0, 0.25)