MouseButton1DoubleClick and MouseButton2DoubleClick?

Can we have a double-click function for GUIs?
[size=2](maybe for ClickDetectors in parts too, but I don’t know)[/size]

[center]MouseButton1DoubleClick
and
MouseButton2DoubleClick[/center]

If we already have this, then I’m not aware ; someone please tell me. :stuck_out_tongue:
I really thought that there was a function for this, but I guess not…?

I know there’s some way to make a double-click work in Roblox without this, but I’m sure a simple function like this would be much easier to do.

You can easily implement your own:

clicked = 0
double_click_interval = 0.25

element.MouseButton1Click:connect(
   function()
      local t = tick()
      if t - clicked <= double_click_interval then
         print("Double clicked")
      end
      clicked = t
   end
)

Let’s not bloat the API with stuff that we can already accomplish, the API should have the basic building blocks that you use to make more complicated stuff happen.

1 Like