Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this LoadAsset script not working?

Asked by 10 years ago

This is part of my script.

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

1 answer

Log in to vote
0
Answered by
Kratos232 105
10 years ago

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!

0
I know how to use loadasset I used it 100 times before, I just derped. EzraNehemiah_TF2 3552 — 10y
Ad

Answer this question