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

Why is this LoadAsset script not working?

This is part of my script.

--Chunk
local model = game:GetChildren("InsertService"):LoadAsset(modelid):GetChildren()[1]
--Chunk

1 answer

✓ Accepted answer

EDIT

It may also be not working, because of how you used GetChildren().

GetChildren() "Returns a read-only table of the object's children." It can't be used to find a specific child, it returns a table. Instead, since you're looking for a Service, try using the GetService() function, so instead of

game:GetChildren("InsertService"):LoadAsset(modelid):GetChildren()[1]

-- use this:

game:GetService("InsertService"):LoadAsset(modelid):GetChildren()[1]

If that's not the only problem, it might be because of the Asset you tried to load.

When you use LoadAsset, remember,

  • Some virus scripts are automatically deleted when a model is loaded.

  • LoadAsset cannot be used offline (in Studio Play or Studio Start Server/Start Player).

  • If called from a Script, the model must be in the inventory of the user ROBLOX or the creator of the place inserting it. If called from a LocalScript, the model must be created by ROBLOX or the place creator.

If none of these are the reason why, maybe you just forgot to set the Variable modelid.

Here's a helpful link!

1 comment

0

I know how to use loadasset I used it 100 times before, I just derped.

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