Help with mobile compatibility

Hello, I’m trying to make my game with mobile support.
Currently, I have a script that controls the door. When you press “E” on a keyboard, it opens.

I made a local script in startergui to attempt to make a mobile button.

 
local function handleAction(actionName, inputState, inputObject)
	if inputState == Enum.UserInputState.Begin then
		print(actionName, inputObject)
	end
end
 
-- Bind action to function
ContextActionService:BindAction("Interact", handleAction, true, Enum.KeyCode.E)

This didn’t work, can someone help?

Did you create a button on screen to activate this script? If not you need to start there. You have to read the entire Creating Mobile Buttons info page, not just copy the first script on it.

print(actionName, inputObject)
This line is where you do whatever you want the script to do.
As it is now it will just print out the actionName and inputObject in the Output window.

I made a script to create the button, that’s all I got so far.
I can’t seem to do anything else.

You need to link the mobile script and the door open script.
I think you need to have your function(s) look for a keyboard or touchscreen input. When that happens (E, or tapping the mobile GUI) then have the door open.