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

Make a GUI visible when a player hovers their cursor over another GUI?

Asked by 9 years ago

I've been trying to figure this out for a while now, but everything I try doesn't work. The code I'm using is:

script.Parent.ClickDetector.MouseHoverEnter:connect(function(hover)
script.Parent.Parent.Textlabel.Visible = true
end)

The only problem is, I can't get a Click Detector inside of a TextButton... Any suggestions?

0
I can tell you its "script.Parent.MouseEnter" Hybric 271 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago
local otherItem = script.Parent.Parent.OtherItem -- Change this to the item that will be hovered over to give the other item visibility

--[[
    The below handler would make your item appear when 'otherItem' is hovered over
]]
otherItem.MouseEnter:connect(function()
    script.Parent.Visible = true
end)

--[[
    The below handler would make your item disappear when 'otherItem' is no longer hovered over
]]
otherItem.MouseLeave:connect(function()
    script.Parent.Visible = false
end)
Ad

Answer this question