This is actually fairly simple.
Using the GetMouse
method of a Player (in a LocalScript of course), we can access their Mouse and what it is 'hovering over' as you said.
01 | local Player = Game.Players.LocalPlayer |
02 | local Mouse = Player:GetMouse() |
04 | Mouse.Move:connect( function () |
05 | if Mouse.Target and Mouse.Target = = Workspace.SpecialHoverBrick then |
06 | Player.PlayerGui.ScreenGui.SpecialHoverGui.Visible = true |
07 | elseif Mouse.Target and Mouse.Target ~ = Workspace.SpecialHoverBrick then |
08 | Player.PlayerGui.ScreenGui.SpecialHoverGui.Visible = false |