It works, but the problem is that, you made SUCH a big plugin with so many modules when you literally have InsertService:LoadAsset(assetId: number). Your code could be something like this
local InsertService = game:GetService("InsertService");
InsertButton.MouseButton1Cilck:Connect(function()
local suc, result = pcall(function()
return string.split(InsertBox.Text, ("," or ";")); -- Seperates it by a comma or a semi-colon.
end);
if suc then
for _, v in pairs(result) do -- Result is a table of all the values.
local suc2, res = pcall(function()
v = tonumber(v);
end); -- Kind of necessary so that we can convert it to a number without errors.
if suc2 then
InsertService:LoadAsset(v);
else
warn(res);
end;
end;
else
warn(result);
end;
end);
There could be errors in this script, but it’s just a test code to show you what I meant.
Also the way the plugin is structured is totally irrelevant and completely fine, so I don’t see the value in commenting on it at all. I’m not interested in unsolicited code review! It’s not very helpful.
It’s been two years since the last update, but because bundle ids now get high enough to conflict with regular asset ids, the plugin now supports explicitly inserting as a bundle. Also added support for inserting player characters.
Contextual buttons won’t work if you’re inserting multiple ids at once atm, instead, for each id it will attempt to insert as an asset → bundle → player.