Add Assets to the Game Using Code
Add Assets to the Game Using Code
Problem
You want to insert a free model from a script, into your game.
Solution
Use the LoadAsset method.
game:GetService('InsertService'):LoadAsset(1234):GetChildren()[1].Parent = Workspace
Discussion
The LoadAsset method takes an argument of what the ID of the asset you’re trying to get. Make sure that the asset is in your models or else you won’t be able to use it. Then it returns a model with the inserted asset in it. To get the first member of this wrapping model I use GetChildren and index the first one. Then this gets parented to the Workspace.