Skip to content

roblox

The roblox namespace and the game global expose Conduit’s read-only-DataModel-plus-writable-property Instance API, mirroring Roblox’s game/Instance surface over the external Luau VM.

roblox.GetInstances() -> {Instance}

Returns every Instance currently reachable in the DataModel tree, capped at 100000 nodes.

for _, inst in roblox.GetInstances() do
print(inst:GetFullName())
end

roblox.GetNilInstances() -> {Instance}

Returns Instances found via a GC scan whose Parent is nil, i.e. objects that exist but are detached from the DataModel tree.

local orphans = roblox.GetNilInstances()
print(#orphans)

roblox.FindFirst(className: string) -> Instance?

Finds the first Instance of the given class name via a GC walk, so it works even for instances not reachable from game’s tree.

local cam = roblox.FindFirst("Camera")

Instance.Name -> string

The instance’s Name, read from the engine via indexing.

print(workspace.Name)

Instance.ClassName -> string

The instance’s class name.

print(part.ClassName)

Instance.Parent -> Instance?

The instance’s parent, or nil at the DataModel root.

local p = part.Parent

Instance.Address -> number

The raw userspace pointer backing the instance, as a number.

local addr = part.Address

Instance:GetChildren() -> {Instance}

Returns a fresh array of the instance’s direct children.

for _, child in ipairs(workspace:GetChildren()) do print(child.Name) end

Instance:FindFirstChild(name: string, recursive: boolean?) -> Instance?

Returns the first direct child (or, if recursive is true, first descendant) matching name, or nil.

local hrp = character:FindFirstChild("HumanoidRootPart")

Instance:FindFirstChildOfClass(className: string) -> Instance?

Returns the first direct child whose ClassName matches; workspace:FindFirstChildOfClass(“Camera”) is routed through a cached singleton lookup instead of a child walk.

local humanoid = character:FindFirstChildOfClass("Humanoid")

Instance:GetDescendants(cap: number?) -> {Instance}

Returns every descendant in pre-order, capped at cap nodes (default 200000, 0 means unlimited); the cap argument is a bridge extension not present on real Roblox Instances.

local all = workspace:GetDescendants()

Instance:GetFullName() -> string

Returns the dot-separated path from the DataModel down to this instance.

print(part:GetFullName())

Instance:IsAncestorOf(other: Instance) -> boolean

Returns true if this instance is an ancestor of other.

if workspace:IsAncestorOf(part) then print("in workspace") end

Instance:IsDescendantOf(ancestor: Instance) -> boolean

Returns true if ancestor is an ancestor of this instance; implemented as the reverse of IsAncestorOf.

if part:IsDescendantOf(workspace) then print("in workspace") end

Instance:WaitForChild(name: string, timeout: number?) -> Instance?

Polls for a direct child named name every 30ms until found, until timeout elapses (default 5s, clamped to at most 30s), or until the engine closes; returns nil on timeout instead of hanging forever like live Roblox.

local hrp = character:WaitForChild("HumanoidRootPart", 10)

Instance:IsInvalidInstance() -> boolean

Returns true if the underlying engine object is no longer valid (destroyed or unreadable).

if part:IsInvalidInstance() then return end

Instance:IsA(className: string) -> boolean

Returns true if the instance’s class matches or inherits from className.

if part:IsA("BasePart") then print(part.Size) end

Instance:FindFirstChildWhichIsA(className: string) -> Instance?

Returns the first direct child whose class matches or inherits from className, or nil.

local part = model:FindFirstChildWhichIsA("BasePart")

Instance:FindFirstAncestor(name: string) -> Instance?

Walks up to 256 parents looking for one named name, or returns nil.

local model = part:FindFirstAncestor("MyModel")

Instance:FindFirstAncestorOfClass(className: string) -> Instance?

Walks up to 256 parents looking for an exact ClassName match, or returns nil.

local ws = part:FindFirstAncestorOfClass("Workspace")

Instance:FindFirstAncestorWhichIsA(className: string) -> Instance?

Walks up to 256 parents looking for one whose class matches or inherits from className, or returns nil.

local model = part:FindFirstAncestorWhichIsA("Model")

Instance:GetService(className: string) -> Instance?

Searches the receiver’s direct children for one whose ClassName matches; called as game:GetService(name) it behaves like the real service lookup, but unlike Roblox it never creates a missing service, it just returns nil.

local players = game:GetService("Players")

Instance:FindService(className: string) -> Instance?

Identical implementation to GetService in this bridge (both are non-creating finds); kept as a separate name for source compatibility.

local rs = game:FindService("ReplicatedStorage")

Instance:GetPlayers() -> {Instance}

Returns the direct children that are Player instances; normally called on the Players service.

for _, plr in ipairs(game:GetService("Players"):GetPlayers()) do print(plr.Name) end

Instance:GetPlayerByUserId(userId: number) -> Instance?

Returns the child Player whose UserId matches, or nil; normally called on the Players service.

local plr = players:GetPlayerByUserId(123456)

Instance:GetPlayerFromCharacter(character: Instance) -> Instance?

Returns the child Player whose Name matches the given character model’s Name, or nil; normally called on the Players service.

local plr = players:GetPlayerFromCharacter(workspace.SomeCharacter)

Instance:GetAttribute(name: string) -> (number | boolean | string | Vector3 | Vector2 | Color3)?

Returns the value of attribute name, or nil if the attribute doesn’t exist or its type isn’t one of the supported types.

local hp = npc:GetAttribute("MaxHP")

Instance:GetAttributes() -> {[string]: (number | boolean | string | Vector3 | Vector2 | Color3)}

Returns a table of every attribute whose type is supported; attributes of unsupported types are silently skipped.

for name, value in pairs(npc:GetAttributes()) do print(name, value) end

Instance:SetAttribute(name: string, value: number | boolean | Vector3 | Vector2 | Color3) -> ()

Writes value into an attribute that already exists; errors if the attribute isn’t present (new attributes can’t be created from outside) or if value’s type doesn’t match the attribute’s existing type.

npc:SetAttribute("MaxHP", 150)

Instance:GetProperties() -> {string}

Returns the names of the instance’s readable properties (not their values); many properties use virtual getters that can’t be read generically.

for _, prop in ipairs(part:GetProperties()) do print(prop) end

Instance:GetPlayingAnimationTracks() -> {Instance}

Returns the AnimationTrack instances currently active on this instance’s Animator (or on self if self is already an Animator).

for _, track in ipairs(humanoid:GetPlayingAnimationTracks()) do print(track.Name) end

Instance:GetPivot() -> CFrame

Returns the instance’s CFrame if it’s a BasePart, or the center of its descendants’ bounding box (identity rotation) otherwise; errors if a Model has no BaseParts.

local cf = model:GetPivot()

Instance:GetBoundingBox() -> (CFrame, Vector3)

Returns an axis-aligned CFrame at the center of, and the size of, the world-space bounding box over every BasePart descendant (Terrain excluded); errors if none are found.

local cf, size = model:GetBoundingBox()

Instance:GetExtentsSize() -> Vector3

Returns just the size component of GetBoundingBox; errors if no BaseParts are found under the instance.

local size = model:GetExtentsSize()

Instance:Raycast(origin: Vector3, direction: Vector3, ignoreList: {Instance}?) -> RaycastResult?

Depth-first walks Workspace (same underlying call as physics.Raycast) and returns the closest BasePart hit, or nil on miss, rate limit, or when raycasting is disabled; blocking, so unsafe to call from a per-frame paint or update callback.

local hit = workspace:Raycast(Vector3.new(0,50,0), Vector3.new(0,-100,0), {character})

Instance:WorldToScreenPoint(worldPos: Vector3) -> (Vector3, boolean)

Projects worldPos through the active Camera, returning a Vector3 of screen X, Y and depth, plus whether the point is within the viewport; errors if there is no active Camera.

local screen, onScreen = workspace.CurrentCamera:WorldToScreenPoint(part.Position)

Instance:WorldToViewportPoint(worldPos: Vector3) -> (Vector3, boolean)

Alias of WorldToScreenPoint; identical implementation.

local screen, onScreen = workspace.CurrentCamera:WorldToViewportPoint(part.Position)

Instance:GetMouseLocation() -> Vector2

Returns the current mouse cursor position; callable on any Instance since it ignores self.

local pos = game:GetMouseLocation()