How to determine the execution priority of 2 `MouseButton1Down` events for the same button?

I have 2 similar MouseButton1Down event for each button:

MyButton.MouseButton1Down:Connect(Function1)
MyButton.MouseButton1Down:Connect(Function2)

When the player clicks the button, I need Function2 to be executed ALWAYS BEFORE Function1.
However, in the randomness of Roblox, sometimes the reverse is true.
I ask here if there is a way to prioritize a certain MouseButton1Down event so that it is executed IN FRONT of another similar one?

PS: I don’t want workarounds, I just want to know if there is any simple property to define this priority for this event.

1 Like

Try this?

local enable = false
MyButton.MouseButton1Down:Connect(Function1)
enable = true
end)
MyButton.MouseButton1Down:Connect(Function2)
if enable == true then
print("Work")
end
enable = false
end)
1 Like

With UI buttons, I don’t think there’s priority that can be set. You can use one connection though.

MyButton.MouseButton1Down:Connect(function()
	Function1()
	Function2()
end)
2 Likes