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.

local Player = Game.Players.LocalPlayer
local Mouse = Player:GetMouse()

Mouse.Move:connect(function()
    if Mouse.Target and Mouse.Target == Workspace.SpecialHoverBrick then
        Player.PlayerGui.ScreenGui.SpecialHoverGui.Visible = true
    elseif Mouse.Target and Mouse.Target ~= Workspace.SpecialHoverBrick then
        Player.PlayerGui.ScreenGui.SpecialHoverGui.Visible = false
    end
end)
Ad

Answer this question