You are repeating a lot of this code, which could be put outside of the if statement.
button.MouseButton1Click:Connect(function()
if not button.Active then return end
button.Active = false
ClickTween(button.Parent.Parent)
if button.Name == "Inventory" then
EnterTween(Inventoryname,InfoLeave,GoalLeave)
elseif button.Name == "Settings" then
EnterTween(Settingsname,InfoLeave,GoalLeave)
elseif button.Name == "Shop" then
EnterTween(Shopname,InfoLeave,GoalLeave)
end
task.wait(1.3)
button.Active = true
end)
for _, button in pairs(script.Parent.Parent.LeftMiddle:GetDescendants()) do
if button:IsA("TextButton") then
button.MouseEnter:Connect(function()
if button.Name == "Inventory" then
EnterTween(Inventoryname,InfoEnter,GoalEnter)
elseif button.Name == "Settings" then
EnterTween(Settingsname,InfoEnter,GoalEnter)
elseif button.Name == "Shop" then
EnterTween(Shopname,InfoEnter,GoalEnter)
end
end)
--[[ Mouse Exit Functions ]]--
button.MouseLeave:Connect(function()
if button.Name == "Inventory" then
EnterTween(Inventoryname,InfoLeave,GoalLeave)
elseif button.Name == "Settings" then
EnterTween(Settingsname,InfoLeave,GoalLeave)
elseif button.Name == "Shop" then
EnterTween(Shopname,InfoLeave,GoalLeave)
end
end)``` Does this look okay?