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

Move mouse out of frame?

How do I stop this when the mouse leaves the fame?

function tweentrans()

repeat wait()
print("OnFrame")
until Box.MouseLeave:connect()

print("leave")
end

script.Parent.MouseEnter:connect(tweentrans)

1 answer

I would use a variable called inFrame, that becomes true when mouseEnter, and false on mouseLeave.

inFrame = false
function tweentrans()

repeat wait()
print("OnFrame")
until inFrame == false

print("leave")
end

script.Parent.MouseEnter:connect(function()
	inFrame = true
	tweentrans()
end)

script.Parent.MouseLeave:connect(function()
	inFrame = false
end)

1 comment

0

This method is inconsistent. If you hover long enough it can keep going after the mouse leaves the frame.

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