Detecting mouse entering button

Ok so to make this clear I do not want a simple script that is easy to do and tells you if the player is hovering over a button instead I would like to know how I can make the script detect if a mouse is entering a button, let this example explain the difference:

I have a simplistic yet easy to use GUI on the side with just textlabels and no background since they’re meant to be easily accessed yet not block the view whenever a textlabel is hovered over a bar will appear on their side like so:image

however I want it so if the player completely leaves the GUI and doesn’t enter the ‘Menu’ GUI it’ll make the bar disappear but I also want it to wait a while to see if the player enters another another part of that little sidemenu. If the player enters ‘example’ instantly after leaving the ‘menu’ UI I want the little bar to not vanish, if the player makes the cursor leave the entire sidemenu and doesn’t bring it back for 0.5 seconds the little bar will have its visibility set to false.

I intend to use this later as well so a breakdown would be nice if it’s not a simple built in function like MouseEnter

I hope I explained this well. I found it hard to explain so if you don’t understand don’t shy away from explaining that. I will do my best to explain it to anyone who feels like it’s not explained well enough.


The Scripting Support category is not the place to ask for scripts. If you have a specific scripting issue, and it hasn’t been solved in a previous thread, then feel free to post your script issues. In your original post, you did not provide any work (actual code) whatsoever that doesn’t work as intended.


I’ll be sure to post my attempts next time however I worked this out after quite some time though but I appreciate the help. I’ll mark your reply as solution so it won’t look unsolved.