Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

why doesn't my mouse leave work?

Please help, I don't get whats wrong and why it isn't working?

script.Parent.MouseEnter:Connect(function()
	script.Parent.Visible = false
	script.Parent.Parent.QuickMatchButton.Visible = true
end)
script.Parent.MouseLeave:Connect(function()
	script.Parent.Visible = true
	script.Parent.Parent.QuickMatchButton.Visible = false
end)

1 comment

0

I have soooo many questions. Is this a LocalScript? What is the error? What does the output say? Is the Parent a GUI? Please give more backstory before posting, thanks.

1 answer

✓ Accepted answer

The problem is very simple. When your GUI's visibility is set to false, it basically acts like it's not there at all and hovering over won't do anything.

A simple fix to your problem is setting the transparency to 0 when leaving and back to 1 when entering (if this is a textbox, I recommend also setting the text transparency to 0/1 when entering/leaving as well). Something like this would work:

script.Parent.MouseEnter:Connect(function()
	script.Parent.BackgroundVisibility = 1
end)

script.Parent.MouseLeave:Connect(function()
	script.Parent.BackgroundVisibility = 0
end)

If you have any questions or issues, please contact me. ;)

2 comments

0

Thanks :3

0

No problem.

This discussion is preserved as it was. New answers, comments, and votes are closed.