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

Help with MouseHoverLeave?

I got when you hover over a part, a gui pops up but when the players mouse leaves, I want the gui to have visible = false

function Leave (Player)
	
end

Part = script.Parent
function Enter (Player)
	for i,v in pairs {Player} do
		
		v.PlayerGui.Hovered.Label.Visible = true
		script.Parent.String.Value = "Cup"
	end
end

Part.ClickDetector.MouseHoverEnter:connect(Enter)

1 answer

✓ Accepted answer
script.Parent.ClickDetector.MouseHoverEnter:connect(function(plr)
    for i,v in pairs {plr} do

        v.PlayerGui.Hovered.Label.Visible = true
        script.Parent.String.Value = "Cup"
    end
end)

script.Parent.ClickDetector.MouseHoverLeave:connect(function(plr)
 plr.PlayerGui.Hovered.Label.Visible = true
--script.Parent.String.Value = "derp"
end)

So first off i redid the organization of the script, it will work the same exact way. Secondly you had everything right. But for the problem you have, you must use the MouseHoverLeave event. This event fires whenever the mouse cursor leaves the click detector.

----Hope i helped you

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