Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Getting a descendant of an object?

local assetId = 1560601706
local instance = game:GetService("InsertService"):LoadAsset(assetId)
print(instance[1])

Why would this not work? Why doesn't it allow me to call the child of instance?

1 answer

✓ Accepted answer

It's not a table, so you can't index it like that, however, you can use :GetChildren() and then index it.

local instance = game:GetService('InsertService'):LoadAsset(assetId):GetChildren()
print(instance[1]) -- Prints its name

1 comment

0

Thanks boss

This discussion is preserved as it was. New answers, comments, and votes are closed.