MouseClick Transparency = 0 but MouseHoverEnter = 1

Hi Roblox Community!

I want to overwrite the command from MouseHoverEnter with MouseClick

The problem is that when i do the mouse click command that the mousehoverenter is still activaded and the mouse click doesent work.

I tried it with this code:

script.Parent.ClickDetector.MouseHoverEnter:Connect(function()
	script.Parent.SelectionBox.Transparency = 0
end)

script.Parent.ClickDetector.MouseHoverLeave:Connect(function()
	script.Parent.SelectionBox.Transparency = 1
end)

script.Parent.ClickDetector.MouseClick:Connect(function()
	script.Parent.ClickDetector.MouseHoverLeave:Connect(function()
		script.Parent.SelectionBox.Transparency = 0
	end)
end)
  • Maini
1 Like
Code
   script.Parent.ClickDetector.MouseHoverEnter:Connect(function()
	script.Parent.SelectionBox.Transparency = 0
end)
script.Parent.ClickDetector.MouseHoverLeave:Connect(function()
	script.Parent.SelectionBox.Transparency = 1
	script.Parent.SelectionBox.Visible = true
end)
script.Parent.ClickDetector.MouseClick:Connect(function()
	script.Parent.SelectionBox.Visible = false
end)

You can make it Visible false when its clicked and when hover leave you can make it visible again.

2 Likes

Sorry the first one was wrong you can try the new one!

The selecting box is away when i click the part but i can fix this.thx for this code!

1 Like