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

How Do I Use MouseHover?

Asked by 9 years ago

I'm trying to listen for the MouseHover event in ClickDetector in order for a GUI to pop up when it's found. When the cursor is over a brick, I want a GUI to pop up and go away when it's gone. Where do I begin? I don't know how to start the script as I've never done anything like this before?

1 answer

Log in to vote
0
Answered by
Joeypm1 10
9 years ago

Here, try this. Insert a billboardgui in the brick, insert a textlabel in the billboardgui. Make sure the billboardgui's size is something bigger than {0,0},{0,0} Edit the textlabel's properties how you want it. Leave the transparencys' to 0, trust me. in the billboardgui, not the textlabel, make sure enabled is FALSE. Insert a script into the brick. In the script:

function onHover() --make a function for MouseHover
script.Parent.BillboardGui.Enabled = true --enable the billboardgui so player can see
end
script.Parent.ClickDetector.MouseHoverEnter:connect(onHover) --connect

function onHoverLeave() --make a function for MouseLeave
script.Parent.BillboardGui.Enabled = false disable the billboardgui so player can NOT see
end
script.Parent.ClickDetector.MouseHoverLeave:connect(onHoverLeave) --connect

This should do it, if not either its not what you wanted or you did it wrong. I tested it in my own place.

0
My output is telling me that ClickDetector is not a member of the Part? bookerjohnson 30 — 9y
0
is your clickdetector named "ClickDetector"? Joeypm1 10 — 8y
Ad

Answer this question