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 simulate a key press when a button is pressed[MOBILE]?

There's this weapon that has a ready feature and to be activated needs F to be pressed. Is it possible for a mobile user to have a button they can press to simulate the F key

1 answer

You can detect if touch is enabled and then show buttons on there screen for aiming and firing. The roblox game assasian does this well.

3 comments

0

I'm trying to press F with a mobile button that's all. Not for aiming and such

0

You can't do that, but when you click the button, you can call the same functions that would be called if you pressed F and it would work the same.

0

if your weapon is using ContextActionService you can just add a true bool to the third argument so it will make a mobile button, see here: https://developer.roblox.com/en-us/api-reference/function/ContextActionService/BindAction

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