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

Mouse Hover script isnt working, how do i fix this? (SOLVED AND EASY TO DO)

So this script is a normal script inside a part with a click detector and a Selection box. What this script is supposed to do is when it senses you have your mouse hovering over it, it activates the Selection box and when you leave it turns visible into false. However, it doesn't work after updates, how do I fix this?

Script:

script.Parent.ClickDetector.MouseHoverEnter:connect(function()

script.Parent.SelectionBox.Visible = true

end)

  

script.Parent.ClickDetector.MouseHoverEnter:connect(function()

script.Parent.SelectionBox.Visible = false

end)

1 answer

✓ Accepted answer

You use

script.Parent.ClickDetector.MouseHoverEnter

Twice, It should be

script.Parent.ClickDetector.MouseHoverEnter:Connect(function()

    script.Parent.SelectionBox.Visible = true

end)

  

script.Parent.ClickDetector.MouseHoverLeave:Connect(function()

    script.Parent.SelectionBox.Visible = false

end)

Also

:connect()

is deprecated for future scripts use

:Connect()

1 comment

0

Omg i feel stupid thx for telling me!

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