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

Why doesnt this code from an official roblox website work?

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

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.

4 comments

0

im pretty sure using assets owned by roblox works right?

0

also the model is in my inventory and it still doesnt work

0

does it print model loaded successfully and also where is the script at

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

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