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

How do I bind a mobile button to the left mouse button?

I want to press the mobile button and it press the left mouse button. I have no clue how to do that or if it's even possible as I'm really new to scripting. This is what I have right now

local contextActionService = game:GetService("ContextActionService") function onButtonPress()

end

local mobilebutton = contextActionService:BindAction("ShootButton",onButtonPress,true,"MouseButton1") contextActionService:SetPosition("ShootButton",UDim2.new(0.72,-25,0.20,-25))

1 answer

Its possible. I would love to ask though why do you need this? Tapping on the screen is left mouse button already. If you want it that way though here you go

contextActionService:BindAction("ShootButton",onButtonPress,true,"MouseButton1Click") --This should work.

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