How can I name a loaded asset?

Hello, I am attempting to make an aircraft spawner system, for which I will be loading the aircraft models from my owned assets. I currently have the following script which successfully loads in the models, however they are named as “model”, and I am looking for a way to assign them a specific name upon loading them in. I have tried multiple solutions, however all had no result/errors. Any way to do this? Thank you.

game:GetService("InsertService"):LoadAsset(50919049).Parent = game.Workspace.Aircraft

(The current asset number is a test, it loads in the Roblox Plane Kit.)

1 Like

Make a variable for when you load an asset e.g.

local asset = game:GetService("InsertService"):LoadAsset(50919049)
asset.Parent = game.Workspace.Aircraft

Then you can name the asset by using the ‘Name’ property.

asset.Name = 'NewName'
4 Likes

Thank you very much, this works.

1 Like

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