Make MoonAnimator's export faster!

So I resently started using MoonAnimator, and I really like it!
It’s so much better than the default one, in my opinion.
But, I was really disapointed by the fact that, when you export your animation,
you have to upload them manualy, so I made this plugin to automate this process.

How does this plugin work?

Each time you select something the plugin checks if the selected instance is a “KeyframeSequence”,
the instance parent’s name is equal to “MoonAnimatorExport”, and instance parent’s parent is “ServerStorage”.
So what this means is it will prompt the save, even if you just select the KeyframeSequence in the MoonAnimatorExport.

Code
local Selection = game:GetService("Selection");
local Connection;

Connection = Selection.SelectionChanged:Connect(function()
	local SelectedInstance = Selection:Get()[1];
	if SelectedInstance and SelectedInstance:IsA("KeyframeSequence") and SelectedInstance.Parent.Name == "MoonAnimatorExport" and SelectedInstance.Parent.Parent == game.ServerStorage then
		plugin:SaveSelectedToRoblox();
	end
end)

plugin.Unloading:Connect(function()
	Connection:Disconnect();
end)

If you have any questions please let me know!

6 Likes

It is recommended to use game:GetService("ServerStorage") here.

It’s also just a common expectation that GetService is used - not all services can be directly indexed anyway (like UserInputService), while others are named differently (RunService is actually named “Run Service”; directly indexing it would mean writing “game[‘Run Service’]”).

1 Like

Thank you for this! I have learned something new today! I’ll make sure I’ll do this if I’m making plugins.

2 Likes