I'm currently making an anti-virus plugin, and I tried implementing a hint system (where a gui would display text when you hover over a gui button and track the mouse). Although, I realised soon after that this was not acting like I would have expected it to act in a normal server.
Firstly:
I am using the MouseEnter, MouseLeave and MouseMoved events on the GUI instances, then moving them to a position using the mouse's X and Y coordinates.
This is an example code (I couldn't be bothered to get it, lol):
Gui.MouseEnter:connect(function()
Hint.Text = "Hm"
Hint.Size = UDim2.new(0, Hint.TextBounds.X, 0, 16)
Hint.Position = UDim2.new(0, Mouse.X, 0, Mouse.Y)
Hint.Visible = true
end)
Gui.MouseMoved:connect(function()
Hint.Position = UDim2.new(0, Mouse.X, 0, Mouse.Y)
Hint.Visible = true
end)
Gui.MouseLeave:connect(function()
Hint.Visible = false
end)
And before you ask, I have already:
- Assigned the variable "Mouse"
- Activated the plugin
- Set the GuiPart's Active value to true
Here is a GIF of the problem that I had:
(First number = Mouse.X, Second number = Mouse.Y)
The same X,Y coordinates were being recorded from the MouseEnter, MouseMoved and MouseLeave events... And yes, I did move the mouse...
So, anyone got any ideas to fix/bypass this problem?
(If anyone's REALLY interested, then here's the Plugin

2 comments
Thank you, I considered that, but doesn't the X and Y co-ords for the events return the offset in relation to the button itself, rather than the global position (so the hint textlabel would have to be in the same frame as the button)?
No, they return absolute coordinates