I’ve been very lazy lately, uploading dozens of animations, because they cant be played (aren’t mine), I use animation spoofer to upload and paste the ids manually, and its very annoying and hard, so i came up with an idea that does not really work as of now, basically im doing a plugin that will get all animations in the entire game and will start prompting the player to upload the keyframe sequences to the roblox library, after that automatically replacing the id’s with the newly uploaded ones, and now im struggling because the script is spamming the upload asset prompt menu, is there a way i can do so it waits until the asset is uploaded and the prompt was closed (pressing the close button on the 2nd publish menu) with successful asset upload result?
Here is my code (Suggested by ChatGPT) :
local toolbar = plugin:CreateToolbar("Animation Auto Uploader")
local pluginButton = toolbar:CreateButton("Start Process", "Replace all anims with your asset ids", "http://www.roblox.com/asset/?id=11672811130")
local Selection = game:GetService("Selection");
local function saveAnimation(Obj)
Selection:Set({typeof(Obj) == 'Instance' and Obj})
wait()
local success, new_id = pcall(function()
return plugin:SaveSelectedToRoblox();
end)
if success then
return new_id
else
return nil;
end
end
pluginButton.Click:Connect(function()
local all_anim_ids = {}
local BIN = Instance.new("Folder", game:GetService("ServerStorage"))
BIN.Name = "Animation_Bin"
-- Collect all unique animation IDs
for _, v in pairs(game:GetDescendants()) do
if v:IsA("Animation") and v.AnimationId ~= nil and not all_anim_ids[v.AnimationId] then
all_anim_ids[v.AnimationId] = true
end
end
local new_ids = {}
for old_id, _ in pairs(all_anim_ids) do
local success, track = pcall(function()
return game:GetService("KeyframeSequenceProvider"):GetKeyframeSequenceAsync(old_id)
end)
if success and track then
track.Parent = BIN
-- Save the animation and get the new ID
local new_id = saveAnimation(track)
if new_id then
new_ids[old_id] = "rbxassetid://" .. new_id
else
warn("Failed to retrieve new animation ID for track: " .. track.Name)
end
else
warn("Failed to get KeyframeSequence for ID: " .. old_id)
end
end
-- Replace old animation IDs with the new ones
for _, v in pairs(game:GetDescendants()) do
if v:IsA("Animation") and new_ids[v.AnimationId] and string.find(tostring(new_ids[v.AnimationId]), "rbxassetid://") then
v.AnimationId = new_ids[v.AnimationId]
end
end
print("Animation upload and replacement process completed!")
end)
Any, help or support, strongly appreciated!