Basically, I want to make my key-bind dash mobile friendly, because at the mo' it only activates when i press Q. I look up context action service and tried to bind my action to a function (Using the help of a YouTube tutorial) . But it doesn't work... Here's my code:
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local punchEvent = ReplicatedStorage:WaitForChild("PunchEvent") --Remote Event
local context = game:GetService("ContextActionService")
local ready = true
local function punch(inputObject, gameProcessed)
UserInputService.InputBegan:Connect()
if inputObject.KeyCode == Enum.KeyCode.F and ready then
punchEvent:FireServer()
ready = false
wait(0.5)
ready = true
end
end
context:BindAction("FirePunchEvent", punch, true, "q")
Can anyone help me?

2 comments
thx bro
np