The best system, while simplistic: It should also be user friendly; the best way to achieve this is to have a folder in Server Storage, put animations in said folder (This could be swapped out for another String Value to put the ID of the animation), then have a String Value named Keybind in each animation.
Here’s an example of both ways:
Scripting Wise
The way I explained above makes it quite easy to script, you could use a remote event to fire when a button is pressed and if it finds that there’s an animation with that keybind, it’ll play that. You do this by using a for I,V in pairs, you then check each Keybind Value to see if they match and if they do; you play the said animation.
Note
If you use the UserInputService feature GetFocusedTextBox(), you can make it so it doesn’t allow itself to trigger while typing a message in the chatbox. i.e;
local UIS = game:GetService("UserInputService")
if UIS:GetFocusedTextBox() == nil then
TweenTabControl()
end
Script
Here’s a little bit of scripting done for ya; you can use this as a reference for your system.
--//Made By MillerrIAm\\--
--/Variables\--
local UIS = game:GetService("UserInputService")
--/Main Script\--
UIS.InputBegan:Connect(function(KeyPressed)
local Key = Enum.KeyCode
local KeybindValue = "Where the keybind is located."
if KeyPressed.KeyCode == Key[KeybindValue] then
if UIS:GetFocusedTextBox() == nil then
TweenTabControl()
end
end
end)
I hope this helps you out, if it solves your issue; make sure you mark it as the solution.