How can I stop the player from ragdolling?

  1. What do you want to achieve? When the player presses the keybind (C) the script fires to the server script which places the Mouse.Target into ragdoll and then pushes them.

  2. What is the issue? The player doesn’t come out of ragdoll

  3. What solutions have you tried so far? none since I really don’t know how ragdolls work and yt tutorials are far from helpful

the server script:

script.Parent.RemoteEvent.OnServerEvent:Connect(function(player, Target)

	print(Target)
	local Magic = player.Character.Magic
	
	for count = 1,10 do
		wait()
		Magic.Value -= 6 -- formular for this number = (amount of magic you want it to take / 10)
	end
	
	local humanoid = Target.Parent.Humanoid
	humanoid:ChangeState(Enum.HumanoidStateType.Physics)
	
	Target.Parent:FindFirstChild("Animate").Disabled = true
	
	for index, joint in pairs(Target:GetDescendants()) do
		if joint:IsA("Motor6D") then
			local socket = Instance.new("BallSocketConstraint")
			local a1 = Instance.new("Attachment")
			local a2 = Instance.new("Attachment")
			a1.Parent = joint.Part0
			a2.Parent = joint.Part1
			socket.Parent = joint.Parent
			socket.Attachment0 = a1
			socket.Attachment1 = a2
			a1.CFrame = joint.C0
			a2.CFrame = joint.C1
			socket.LimitsEnabled = true
			socket.TwistLimitsEnabled = true
			joint:Destroy()
		end
	end
	
	local bv = Instance.new("BodyVelocity")
	bv. Velocity = player.Character.HumanoidRootPart.CFrame.LookVector * 3000
	bv.P = 2000
	bv.MaxForce = Vector3.new(2000,2000,2000)
	bv.Parent = Target.Parent.HumanoidRootPart
	
	wait(0.4)
	bv:Destroy()	
	humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
	Target.Parent:FindFirstChild("Animate").Disabled = false

		
end)

all help is appreciated <33

1 Like