Can anyone help with this code? All it does it goes grey then white then doesnt work
script.Parent.MouseEnter:Connect(function() local e = 1 for i = 1, 10 do script.Parent.TextLabel.TextLabel_Roundify_4px.ImageTransparency = e - .10 print(e) end end) script.Parent.MouseLeave:Connect(function() local e = 0 for i = 1, 10 do script.Parent.TextLabel.TextLabel_Roundify_4px.ImageTransparency = e + .10 print(e) end end)
I assume you want to change the ImageTransparency. Using Tween Service:
script.Parent.MouseLeave:Connect(function() local image = script.Parent.TextLabel.TextLabel_Roundify_4px -- The Tween local transparencyGoal = {ImageTransparency = 1} local transparencyInfo = TweenInfo.new(1) local transparencyTween = TweenService:Create(image, transparencyInfo, transparencyGoal) -- Play the tween transparencyTween:Play() end)
or if you want to use the loop
script.Parent.MouseLeave:Connect(function() -- The Image local image = script.Parent.TextLabel.TextLabel_Roundify_4px -- The Loop for i = 1, 1, 0.1 do wait(1) image.ImageTransparency = i end end)