What would be the best method for this?

Say for example I have these buttons:
image

Currently, I have:

mouse button1press connect function
if pressed == selectButton then
ContextActionService:BindAction()
elseif pressed = moveButton then 
so on and so forth

Is there a better way of doing this? Thanks!

1 Like

The best way of doing this would probably be detecting it for the buttons themselves.

local selectButton = yourSelectButton
local moveButton = yourMoveButton

selectButton.Activated:Connect(function()
    -- whatever functionality
end)

moveButton.Activated:Connect(function()
    -- whatever functionality
end)

This is just a bit more of a standard practice.