I’m currentley using CAS to bind and unbind the jump key to certain functions, so it is mobile accessible.
However, I am running into an error with the unbinding and rebinding of the jump button, where it will only work before the tool is equipped, then once it is unequipped it stops working.
Here is the code in question;
local function OnJumpAction(actionName, inputState, inputObject)
if inputState == Enum.UserInputState.Begin and not equipped.Value then
humanoid.JumpPower = 50
if humanoid:GetState() == Enum.HumanoidStateType.Freefall then
print("a")
end
end
end
equipped.Changed:Connect(function()
if equipped.Value == true then
humanoid.JumpPower = 0
ContextActionService:BindAction("flickerStep", OnFlashStepAction, true, Enum.KeyCode.Space)
elseif equipped.Value == false then
ContextActionService:BindAction("jumpAction", OnJumpAction, false, Enum.KeyCode.Space)
end
end)
humanoid.JumpPower = 50
I have tried many different ideas, yet none have worked
when you bind spacebar to OnFlashStepAction, it also unbinds the jump key i think, once you unbind spacebar to OnFlashStepAction, you should be able to jump again, so it should look something like this maybe?
equipped.Changed:Connect(function()
if equipped.Value == true then
ContextActionService:BindAction("flickerStep", OnFlashStepAction, true, Enum.KeyCode.Space)
elseif equipped.Value == false then
ContextActionService:UnbindAction("flickerStep" )
end
end)