local ReplicatedStorage = game:GetService("ReplicatedStorage") local Players =…
- User
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Players = game:GetService("Players") local localPlayer = Players.LocalPlayer local PlayerGui = localPlayer:WaitForChild("PlayerGui") local MainMenuGui = PlayerGui:WaitForChild("MainMenuGui") local MainFrame = MainMenuGui:WaitForChild("MainFrame") local Animation = MainFrame:WaitForChild("Animation")
local categories = { {name = "Male", folder = ReplicatedStorage:WaitForChild("Animations"):WaitForChild("Male"), template = ReplicatedStorage:WaitForChild("ButtonTemplates"):WaitForChild("MaleTemplate"), list = Animation:WaitForChild("Men_List")}, {name = "Female", folder = ReplicatedStorage:WaitForChild("Animations"):WaitForChild("Female"), template = ReplicatedStorage:WaitForChild("ButtonTemplates"):WaitForChild("FemaleTemplate"), list = Animation:WaitForChild("Women_List")}, {name = "ThreePlus", folder = ReplicatedStorage:WaitForChild("Animations"):WaitForChild("ThreePlus"), template = ReplicatedStorage:WaitForChild("ButtonTemplates"):WaitForChild("ThreePlusTemplate"), list = Animation:WaitForChild("Plus_List")}, {name = "Emote", folder = ReplicatedStorage:WaitForChild("Animations"):WaitForChild("Emotes"), template = ReplicatedStorage:WaitForChild("ButtonTemplates"):WaitForChild("EmoteTemplate"), list = Animation:WaitForChild("Emote_List")} }
local All_List = Animation:WaitForChild("All_List")
local function hideAllLists() for _, category in categories do category.list.Visible = false end All_List.Visible = false end
local function showList(list) hideAllLists() list.Visible = true end
local function setupButtons(category) for _, anim in category.folder:GetChildren() do local button = category.template:Clone() button.Name = anim.Name button.Text = anim.Name button.Parent = category.list
codelocal allButton = button:Clone() allButton.Parent = All_List endend
for _, category in categories do setupButtons(category) end
local TitleLabel = script.Parent:WaitForChild("TitleLabel") local buttons = { ["+"] = {TitleLabel:WaitForChild("+"), function() showList(Animation:WaitForChild("Plus_List")) end}, ["ALL"] = {TitleLabel:WaitForChild("ALL"), function() showList(All_List) end}, ["E"] = {TitleLabel:WaitForChild("E"), function() showList(Animation:WaitForChild("Emote_List")) end}, ["M"] = {TitleLabel:WaitForChild("M"), function() showList(Animation:WaitForChild("Men_List")) end}, ["W"] = {TitleLabel:WaitForChild("W"), function() showList(Animation:WaitForChild("Women_List")) end} }
for _, buttonInfo in buttons do local button, callback = unpack(buttonInfo) button.MouseButton1Click:Connect(callback) end
if the button is clicked and its assigned list is visible, make it invisible and make the 'All_+
- Assistant