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

Why doesnt this code from an official roblox website work?

Asked by 3 years ago

Im trying to make a car spawner currently, the model is owned by roblox by the way if the model doesnt load in the output it says model failed to load so yea

script.Parent.MouseButton1Click:connect(function()
    local assetId = 163379061 
    local InsertService = game:GetService("InsertService")
    local success, model = pcall(InsertService.LoadAsset, InsertService, assetId)
    if success and model then
        print("Model loaded successfully")
        model.Parent = workspace
    else
        print("Model failed to load!")
    end

end)

1 answer

Log in to vote
0
Answered by
Cirillix 110
3 years ago

You cannot use InsertService anymore if you don't own the specific asset. You have to get the asset and have it in your inventory.

0
im pretty sure using assets owned by roblox works right? Lord_F1re 1 — 3y
0
also the model is in my inventory and it still doesnt work Lord_F1re 1 — 3y
0
does it print model loaded successfully and also where is the script at Cirillix 110 — 3y
0
No, the script doesnt print loaded successfully, it prints failed to load. for your other question, the local script is located inside a text button Lord_F1re 1 — 3y
Ad

Answer this question