Accessory Inserter Plugin

My new plugin, Accessory Inserter, is officially out!

This plugin took quite some time to make, so please give it some love!
Here is the link to it:

Note: It is still in beta, so it will have bugs.

Source Code for anyone who thinks it is a virus:


-- Plugin Setup
local Toolbar = plugin:CreateToolbar("Accessory Inserter")
local Button = Toolbar:CreateButton("Accessory Inserter", "", "rbxassetid://8152302521")
local GUI = script.GUI:Clone()
GUI.Parent = game:GetService("CoreGui")

-- Services

local MarketplaceService = game:GetService("MarketplaceService")
local InsertService = game:GetService("InsertService")

-- This service is used for setting the selected items in studio to the spawned accessory after spawning it in.
local Selection = game:GetService("Selection")

-- Helpful Variables

local ImageLink = "http://www.roblox.com/Thumbs/Asset.ashx?format=png&width=250&height=250&assetId="

local MainFrame = GUI.MainFrame
local IDBox = MainFrame.IDBox
local Container = GUI.Container

-- Open/Close GUI

Button.Click:Connect(function()
    GUI.Enabled = not GUI.Enabled
end)

-- Functions for Later

local function GetImage()
    return ImageLink..tostring(IDBox.Text)
end

-- Update Image

IDBox.Changed:Connect(function()
    MainFrame.ItemImage.Image = GetImage()
end)

-- The Main Function of the Plugin (To spawn the accessory in)

MainFrame.SpawnButton.MouseButton1Click:Connect(function()
    local id = tonumber(IDBox.Text)
    local clone = InsertService:LoadAsset(id):Clone()
    local item
    
    -- Whenever you use InsertService, the item spawns in a model, so we must do this to take it out of the model.
    
    
    for i,v in pairs(clone:GetChildren()) do
        v.Parent = workspace
        item = v
    end
    
    Selection:Set({[1] = item})
    --workspace.CurrentCamera.CFrame = item.Handle.CFrame
end)

-- Rainbow Container

local color = 0
local frame = Container

while true do
    local hsv = Color3.fromHSV(color,1,1)
    frame.BackgroundColor3 = hsv
    color = color + 1/255

    if color >= 1 then
        color = 0
    end

    wait()
end
3 Likes