Created
February 22, 2021 03:17
-
-
Save TheNextGuy32/3121bc94356745c37c8bbb7c28dd1aa1 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
return function(path, beginWith) | |
if path == nil then | |
return nil | |
end | |
local paths ={} | |
local i=1 | |
if path == nil then | |
return nil | |
end | |
for str in string.gmatch(path, "([^/]+)") do | |
path[i] = str | |
i = i + 1 | |
end | |
local item = game.ReplicatedStorage | |
if beginWith ~= nil then | |
item = beginWith | |
end | |
for i, nextPathItem in ipairs(paths) do | |
item = item:WaitForChild(nextPathItem) | |
end | |
return item | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment