How to Prevent Player from getting up after being ragdolled

Whenever the player jumps they just get out of ragdoll

local UserInputService = game:GetService("UserInputService")

local RagdollRemote = game.ReplicatedStorage:WaitForChild("RagdollRemote")

local IsRagdolled = false

local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Humanoid = Character:FindFirstChild("Humanoid")


UserInputService.InputBegan:Connect(function(Input,GameProcessedEvent)
	if not GameProcessedEvent and Input.KeyCode == Enum.KeyCode.R then
		print("Ragdoll")
		if IsRagdolled == true then
			IsRagdolled = false
			RagdollRemote:FireServer(false)
			Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
		else
			IsRagdolled = true
			RagdollRemote:FireServer(true)
			Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
		end
	end
end)``

You could try disabling their controls like in this post: Disabling Character Controls?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.