So in my game, I have a script where if you press " Q " something will happen, not important.

How do I add it to a phone button?

So when you press that phone button it's the same as pressing " Q " on keyboard

local BLAH = game:GetService("ContextActionService")
function onButtonPress()
print("a")   <--- simulate the q press
end
local mobilebutton = BLAH:BindAction("ButtonQ",onButtonPress,true,"Q")
BLAH:SetPosition("ButtonQ",UDim2.new(0.75,-25,0.01,-25))
BLAH:SetImage("ButtonQ","http://www.roblox.com/asset/?id=2273081")

2 comments

0

Can you be a little bit more clear? The script works fine

0

To test it on a phone you can use the emulator.