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

How do you test if the player's mouse is on a text button for a certain amount of time?

1 answer

Here is the code I made:

local Button = script.Parent.TextButton

local Wait = 0

function YourFunction()

print("Worked")

end

Button.MouseEnter:Connect(function()

wait(1)

Wait = 1

end)

Button.MouseLeave:Connect(function()

if Wait >= 1 then

YourFunction()

Wait = 0

else

Wait = 0

end

end)

1 comment

0

smh... Seriously, evaera make StackEdit compatible.....

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