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

How do you loop a MouseHoverEnter?

Asked by 8 years ago
local part = script.Parent.Parent
repeat
    wait(0.1)
until
script.Parent.Parent.Purchases:FindFirstChild(part.Object.Value) 
local dart = script.Parent.Parent.Purchases:FindFirstChild(part.Object.Value)
repeat
script.Parent.Head.ClickDetector.MouseHoverEnter:connect(function(playerwhoclicked)
    print("hello")
    script.Parent.Head.ClickDetector.MouseHoverLeave:connect(function(playerwhoclicked)
            if script.Parent:FindFirstChild(part.Object.Value) then
            local ghostobjecty=script.Parent:FindFirstChild(part.Object.Value)
            ghostobjecty:Remove()
            end
        end)
end)
wait(0.1)
until
script.Parent.Parent.Object.Value=="nothing"

In the upper script I am trying to use the repeat loop type to loop the MouseHoverEnter Without it this script only works once and I want hello to be printed everytime that the mouse hovers over a brick

However, it does print hello, but only once, and it removes the ghostobjecty even before my mouse hovers of it, making the script worser than before.

Please help

0
omg Volodymyr2004 293 — 8y

Answer this question