Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How Do I Use MouseHover?

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

✓ Accepted answer

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.

2 comments

0

My output is telling me that ClickDetector is not a member of the Part?

0

is your clickdetector named "ClickDetector"?

This discussion is preserved as it was. New answers, comments, and votes are closed.