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

How to insert a model with a script?

Asked by 8 years ago

So when you load up the script the model loads up with it or whatever you built to go with the script

1 answer

Log in to vote
1
Answered by 8 years ago

You would do this by using the InsertService - Wiki page

You would then insert your model using the LoadAsset method. This inserts your model into another model, so you would need to grab the first child of the model to find your model:

local ID = 0000000 --Change this to the model ID
local InsertService = game:GetService("InsertService") --Get the service

local Model = InsertService:LoadAsset(ID) --Insert the model
local NewModel = Model:GetChildren()[1] --Find your model

NewModel.Parent = workspace --Put it into the game
Model:Destroy() --Destroy the container model
0
So i would need to put my model up as my own model? TheEmoWu 35 — 8y
0
The model would need to be in your Roblox inventory, yes. You can upload models by right clicking on them in studio and clicking "Publish to Roblox" darkelementallord 686 — 8y
0
If it is someone else's model which you own, that would still work. It just has to be in your inventory. darkelementallord 686 — 8y
0
How would you do this as a gui? Rdumb1 4 — 5y
Ad

Answer this question