Hey, here I’m looping through TextLabels in a frame, each of these textlabels has a button inside (yes, I will switch to TextButtons after). This script mostly works, when the mouse enters and leaves the colours change, and when activated it plays a small animation. This all works, except when you spam click two at a time, then the colour freezes. This is a small gif of the issue and my code:
for i, v in pairs(menu.List:GetChildren()) do
if v:IsA("TextLabel") then
v.Button.MouseEnter:Connect(function()
TS:Create(v.Button, TI, {BackgroundTransparency = 0}):Play()
TS:Create(v.Button, TI, {BackgroundColor3 = EnabledStateColour}):Play()
TS:Create(v, TI, {TextColor3 = Color3.fromRGB(255, 255, 255)}):Play()
end)
v.Button.MouseLeave:Connect(function()
TS:Create(v.Button, TI, {BackgroundTransparency = 1}):Play()
TS:Create(v.Button, TI, {BackgroundColor3 = DisabledStateColour}):Play()
TS:Create(v, TI, {TextColor3 = Color3.fromRGB(0, 0, 0)}):Play()
end)
v.Button.Activated:Connect(function()
TS:Create(v.Button, TI, {BackgroundTransparency = 1}):Play()
TS:Create(v.Button, TI, {BackgroundColor3 = DisabledStateColour}):Play()
TS:Create(v, TI, {TextColor3 = Color3.fromRGB(0, 0, 0)}):Play()
wait(.03)
TS:Create(v.Button, TI, {BackgroundTransparency = 0}):Play()
TS:Create(v.Button, TI, {BackgroundColor3 = EnabledStateColour}):Play()
TS:Create(v, TI, {TextColor3 = Color3.fromRGB(255, 255, 255)}):Play()
end)
end
end