Created
March 19, 2025 06:06
-
-
Save Sleitnick/883dea78f441443a001ddb96742c03eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--!strict | |
local function find(parent: Instance, ...: string): Instance | |
local instance = parent | |
for i = 1, select("#", ...) do | |
local name = (select(i, ...)) | |
local inst = instance:FindFirstChild(name) | |
if inst == nil then | |
error(`failed to find instance "{name}" in {instance:GetFullName()}`, 2) | |
end | |
instance = inst | |
end | |
return instance | |
end | |
return find |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment