How can I insert a package with PackageService?

The PackageService API does not really hint that you can insert a copy of a package via script. Having something like this would be handy.

local PackageService = game:GetService("PackageService")
local myPackage = PackageService:Insert("<Roblox Asset URL>")
-- Move myPackage somewhere, configure it, etc.

Does everyone just store copies of their packages in ServerStorage and clone those?

A package is an asset just like any other (Decal, model, mesh, etc.) you can just use the roblox InsertService to insert the package into your game :slightly_smiling_face:

Code example:

local assetId = 257489726 -- your package asset ID
local InsertService = game:GetService("InsertService")
local model = InsertService:LoadAsset(assetId)
model.Parent = workspace
1 Like

An easier method for inserting assets would be to use the command bar with the given code:

game:GetService("InsertService"):LoadAsset(AssetID).Parent = workspace

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