How to disable UserInputService

I’m trying to make it so that when a player is ragdolled, none of the user inputs work. Any answers would be appreciated, thanks.

When they press a key, check if they’re ragdolled.

You can’t disable UserInputService, however ContextActionService is a lot more flexible with handling inputs. This is a snippet of a script that would block specified input, assuming everything was using ContextActionService like the default character scripts are:

local ContextActionService = game:GetService("ContextActionService")

-- table for blocked actions, you can add some here if need be
-- this should only be filled with Enum.PlayerActions, Enum.KeyCode, and/or Enum.UserInputType
local blockedInputs = {}

-- this will add all character actions (Forward, Backward, etc) to the blocked actions
for _, playerAction in pairs(Enum.PlayerActions:GetEnumItems()) do
	table.insert(blockedInputs, playerAction)

-- block input
	-- bind name
	-- bind function for keypresses and actions
		-- Sink will make all actions stop here and not continue to other context actions
		return Enum.ContextActionResult.Sink
	-- should we create a touch button? 
	-- priority level. it should be higher than your other actions
	-- inputs for the action, which for the block input we will just unpack the table above

and if you needed to unblock input at any point, you would call this function after:


I hope this helps!