How can i make this script compatible with mobile and computer?

So im trying to make this script work with both devices but im not sure how to, how can i do this? If a player is on mobile they have to click a button but if they are on pc they have to click F

	uis.InputBegan:Connect(function(input, isTyping)
	if equip == true then

	if isTyping then
		return
		elseif script.Parent.Parent.Parent.Parent:WaitForChild("Block").MouseButton1Click or input.KeyCode == Enum.KeyCode.F then
			print('F or M')
		local standName = script.Parent.Parent.StandName.Text
		if debounce == false and IsActive == true then
			debounce = true
			IsActive = false

			Block:FireServer(IsActive, standName)
			wait(cd)
			debounce = false
		elseif debounce == false and IsActive == true then
			debounce = true
			IsActive = false

			Block:FireServer(IsActive, standName)
			wait(cd)
			debounce = false
			end
		end
	else
		return
	end
end)

You should check this out, it makes it easy to add compatibility

You can use UserInputService to detect which device an user is using.

if UserInputService.KeyboardEnabled == true then
    --Hide the mobile button here, the button will be visible on others devices
end

To make it work on mobile you can make the same script but that runs when the button is pressed.

Im not sure how to use that for my script, and it seems a bit complex

how can i do that for mobile?

You put the script you are currently using in the button, but you don’t use the uis, instead to use the mouseButton1Click