Ok so I have alittle problem. Whenever the player presses S or the down arrow while in a roblox vehicleseat, they start braking. I do not want the car to break so how do i unbind this action while the player is in a vehicle seat?
I have tried detecting whenever the throttle is -1 and instead setting it to zero but this does not work.
Thanks to help from the post here. I managed to get a working result:
--LocalScript inside StarterPlayer.StarterCharacterScripts
local ContextActionService = game:GetService("ContextActionService")
local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
function Disable()
ContextActionService:BindActionAtPriority("disableBackwardMovement", function()
return Enum.ContextActionResult.Sink
end, false, Enum.ContextActionPriority.Default.Value + 50, Enum.PlayerActions.CharacterBackward)
end
Humanoid:GetPropertyChangedSignal("Sit"):Connect(function()
if Humanoid.Sit then
Disable()
else
ContextActionService:UnbindAction("disableBackwardMovement")
end
end)