Yuari
Documentation
Docs/Instances/getinstancesbyclass

getinstancesbyclass

Returns all descendants whose ClassName matches exactly.

Syntax

getinstancesbyclass(className: string) -> table

Parameters

ParameterTypeDescription
classNamestringThe Roblox class name to match.

Returns

TypeDescription
tableAll descendants whose ClassName matches exactly

Description

getinstancesbyclass is part of the Instances library. Instance helpers traverse the live DataModel and return instance proxies tied to the current game session.

The call is read-only: it resolves the current value when invoked and does not change the underlying state.

Example

for _, part in ipairs(getinstancesbyclass("Part")) do
    print(part.Name)
end

Notes

  • Returned instances are live proxies; they can become invalid if the object is destroyed.