Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

How do you get a gui shown up on a character screen when they have their mouse hover over the brick?

Asked by 10 years ago

I could'nt find anything on ROBLOX wiki.

1 answer

Log in to vote
1
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
10 years ago

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.

01local Player = Game.Players.LocalPlayer
02local Mouse = Player:GetMouse()
03 
04Mouse.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
09    end
10end)
Ad

Answer this question