local cas = game:GetService("ContextActionService")
cas:BindActionAtPriority("DisableControls",function()
return Enum.ContextActionResult.Sink
end,false,Enum.ContextActionPriority.High.Value, unpack(Enum.PlayerActions:GetEnumItems()))
Then unbind the action when you want to re-enable the controls.
cas:UnbindAction("DisableControls")
Just a side-solution I don’t know the answer to your question.