How to insert models from toolbox with a script?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to be able to insert certain models from the toolbox using a script

  2. What is the issue? Include screenshots / videos if possible!
    I’m no good at scripting, I can barely even script simple stuff and the most impressive thing I made was a flashlight that recharges when you touch it against a specific part

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I did find the exact issue I had here on the DevForum, but there was no script, only a vague reference to LoadAsset, which while I have seen I’m not sure how to use myself

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

-- This is an example Lua code block

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like

You need to own the model in order to use :LoadAsset().
Right click on the item you want from the toolbox and click “Copy Asset ID”. The next thing you want to do is right click on the item again and view in the browser and click the “Get Model” button.

In a script you can load the asset via InsertSerivce:

You will have to parent the item to the workspace, or wherever you would like to.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.