Basically, I made a hover over system, where the text will change colors.
Now, it works, but the biggest issue is related to what happens after the tween.
The related script is this:
for _, button in pairs(Pattern.CanvasGroup:GetDescendants()) do
if button:IsA("TextButton") then
button.MouseEnter:Connect(function()
TS:Create(button, TI, {TextColor3 = Color3.fromRGB(69, 255, 66)}):Play()
end)
button.MouseLeave:Connect(function()
TS:Create(button, TI, {TextColor3 = Color3.fromRGB(0, 0, 0)}):Play()
end)
elseif table.find(ClickedButtons, button) then
return
end
end
Is there any other script that changes the text color?
Also, you should be using continue instead of return if you want to just skip to the next loop instead of breaking the loop.
New code:
for _, button in pairs(Pattern.CanvasGroup:GetDescendants()) do
if button:IsA("TextButton") then
local textColor = button.TextColor3
button.MouseEnter:Connect(function()
TS:Create(button, TI, {TextColor3 = Color3.fromRGB(69, 255, 66)}):Play()
end)
button.MouseLeave:Connect(function()
TS:Create(button, TI, {TextColor3 = textColor}):Play()
end)
elseif table.find(ClickedButtons, button) then
continue
end
end
Because you’re using back easing style. This makes values go over 255 and under 0 causing the values to be relocated. For example, if you do 255 + 5 it would be 5. Subsequently, a value of 0 - 5 would return 250, which is basically white.