Hi,
I’m looking to unbind the jump button but I can’t and don’t want to set the JumpPower and instead want to use ContextActionService to unbind the jump button, however on mobile, the jump button is a gui button, but on pc it’s space and I think it’s A/X on console. What I’m wondering is if there’s some way to handle all of these with a single enum?
local contextActionService = game:GetService('ContextActionService')
local players = game:GetService('Players')
local replicatedStorage = game:GetService('ReplicatedStorage')
local userInputService = game:GetService('UserInputService')
local remotes = replicatedStorage:WaitForChild('Remotes')
local unRagdollClient = remotes:WaitForChild('UnRagdollClient')
local localPlayer = players.LocalPlayer
contextActionService:BindActionAtPriority('jumpRequest', function() -- this seems to just disable jumping
if localPlayer.Character and localPlayer.Character:GetAttribute('IsRagdolled') then
print('ok') -- never prints
unRagdollClient:FireServer()
return Enum.ContextActionResult.Sink
else
print(localPlayer.Character, localPlayer.Character:GetAttribute('IsRagdolled')) -- also never prints
end
return Enum.ContextActionResult.Pass
end, false, Enum.ContextActionPriority.Default.Value + 1, Enum.UserInputType.Jump) -- obviously UserInputType.Jump doesn't exist