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

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

Asked by 5 years ago
Edited 5 years ago

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

Log in to vote
0
Answered by 5 years ago

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()

0
Omg i feel stupid thx for telling me! Adenandpuppy 87 — 5y
Ad

Answer this question