All these MouseEnter and MouseLeave connections handle animations for text which displays the title/purpose of the “bar”.
Is there an alternative way of handling many connections without having to do this?
local BarTweenInfo = TweenInfo.new(.25, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
Bar_Health.Parent.Hover.MouseEnter:Connect(function()
t:Create(Bar_Health.Parent.HealthTitle,BarTweenInfo, {TextTransparency = 0}):Play()
end)
Bar_Health.Parent.Hover.MouseLeave:Connect(function()
t:Create(Bar_Health.Parent.HealthTitle,BarTweenInfo, {TextTransparency = 1}):Play()
end)
Bar_Hunger.Parent.Hover.MouseEnter:Connect(function()
t:Create(Bar_Hunger.Parent.HungerTitle,BarTweenInfo, {TextTransparency = 0}):Play()
end)
Bar_Hunger.Parent.Hover.MouseLeave:Connect(function()
t:Create(Bar_Hunger.Parent.HungerTitle,BarTweenInfo, {TextTransparency = 1}):Play()
end)
Bar_Thirst.Parent.Hover.MouseEnter:Connect(function()
t:Create(Bar_Thirst.Parent.ThirstTitle,BarTweenInfo, {TextTransparency = 0}):Play()
end)
Bar_Thirst.Parent.Hover.MouseLeave:Connect(function()
t:Create(Bar_Thirst.Parent.ThirstTitle,BarTweenInfo, {TextTransparency = 1}):Play()
end)
breathBar.Parent.Hover.MouseEnter:Connect(function()
t:Create(breathBar.Parent.OxygenTitle,BarTweenInfo, {TextTransparency = 0}):Play()
end)
breathBar.Parent.Hover.MouseLeave:Connect(function()
t:Create(breathBar.Parent.OxygenTitle,BarTweenInfo, {TextTransparency = 1}):Play()
end)
staminaBar.Parent.Hover.MouseEnter:Connect(function()
t:Create(staminaBar.Parent.StaminaTitle,BarTweenInfo, {TextTransparency = 0}):Play()
end)
staminaBar.Parent.Hover.MouseLeave:Connect(function()
t:Create(staminaBar.Parent.StaminaTitle,BarTweenInfo, {TextTransparency = 1}):Play()
end)