What is wrong with my script here? I am trying to change the color of a text button while it is hovered over

What i’m trying to do is make it so that the text color changes while it’s being hovered over. When I hover over, it changes color, but when i leave the area of the text button, it never changes back? I’m not getting any errors in output.

script.Parent.MouseEnter:Connect(function()
	script.Parent.TextColor3 = Color3.new(1, 0.999969, 0.999985)
	if script.Parent.MouseEnter == false then
		script.Parent.TextColor3 = Color3.new(0.714199, 0.714336, 0.714183)
	end
end)

Use .MouseLeave instead of mouseenter = false.

1 Like
script.Parent.MouseEnter:Connect(function()
     --change colour for hover over
end

script.Parent.MouseLeave:Connect(function()
    --set the colour back to the normal colour
end
script.Parent.MouseEnter:Connect(function()
	script.Parent.TextColor3 = Color3.new(1, 0.999969, 0.999985)
end)

script.Parent.MouseLeave:Connect(function()
       script.Parent.TextColor3 = Color3.new(Your colour here)
end)
1 Like

i see there was a mouse leave feature. lol thanks man

1 Like