Unragdolling and ragdoll cancel dash issues

Whenever my character unragdolls, sometimes my character flings, just lays there for a few seconds, or flipped upside down with their head inside the floor. I’ve tried delaying auto rotate , setting the humanoid states, and setting my characters velocity to zero.
I’ve also resorted to AI which didn’t help at all.

I have a ragdoll cancel dash script which might work if the unragdoll script is working. But I’ll put the code just in case.


i just used clips on my phone so ignore the cuts this just shows the issues, Two cuts has a working unragdoll and ragdoll cancel dash though

Ragdoll Client

local camera = workspace.CurrentCamera
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local head : Part = char:WaitForChild("Head")
local hum : Humanoid = char:WaitForChild("Humanoid")

local noCamShake = true
local antiMove = false
local ragdollstate = false
local remote = game.ReplicatedStorage.Remotes.Ragdoll

local function focus(arg)
	if arg == "Focus" then
		if noCamShake then
			camera.CameraSubject = head
			hum.RootPart.CanCollide = false
		end
	elseif arg == "Unfocus" then
		if noCamShake then
			camera.CameraSubject = hum
			hum.RootPart.CanCollide = true
		end	
	end
end
local function noMove(arg)
	if arg == "Stop" then
		if antiMove then
			hum.WalkSpeed = 0
			hum.PlatformStand = true
		end
	elseif arg == "Aan" then
		if antiMove then
			
			
			hum.WalkSpeed = game.StarterPlayer.CharacterWalkSpeed
			hum.JumpHeight = game.StarterPlayer.CharacterJumpHeight

			for _, part in ipairs(char:GetDescendants()) do
				if part:IsA("BasePart") then
					part.AssemblyLinearVelocity = Vector3.zero
					part.AssemblyAngularVelocity = Vector3.zero
				end
			end
			hum.PlatformStand = false
		end
	end
end

remote.OnClientEvent:Connect(function(arg, sec)
	if hum then
		if arg == "Make" or arg == nil and sec == "manualM" then
			--hum:SetStateEnabled(Enum.HumanoidStateType.FallingDown, true)
			--hum:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, true)
			hum:ChangeState(Enum.HumanoidStateType.Physics)
			--hum.PlatformStand = true

			ragdollstate = true
			focus("Focus")
			noMove("Stop")
		elseif arg == "Destroy"  or arg == nil and sec == "manualD" then
			hum:SetStateEnabled(Enum.HumanoidStateType.Physics, false)

			hum:ChangeState(Enum.HumanoidStateType.Ragdoll)

ragdollstate = false
			delay(task.wait(0.2),function()
			
			hum:ChangeState(Enum.HumanoidStateType.GettingUp)
			end)
			focus("Unfocus")
			noMove("Aan")
		
		end
		
	end
end)

if script.Parent == game.Workspace then
	error("wont run")
end

local char = script.Parent

game:GetService("RunService").RenderStepped:Connect(function()
	if ragdollstate then
		for _, part in ipairs(char:GetDescendants()) do
			if part:IsA("BasePart") then
				part.AssemblyLinearVelocity = Vector3.zero
				part.AssemblyAngularVelocity = Vector3.zero
				part.RotVelocity = Vector3.zero
				part.Velocity = Vector3.zero
			end
		end
	end
end)

Ragdoll Module

local remote = game.ReplicatedStorage.Remotes.Ragdoll


local EffectModule = {}



function EffectModule.OverTimeDamage(char, duration, timebetweendamage, damage,particletype,cause)

	local humanoid = char:FindFirstChildOfClass("Humanoid")
	local Particle = game.ReplicatedStorage.Vfx.DamageOverTimeParticles:WaitForChild(particletype)
	if humanoid then
		local particles = {}
		
		for _, limb in ipairs(char:GetChildren()) do
			if limb:IsA("BasePart") then
				local clone = Particle:Clone()
				clone.Parent = limb
				table.insert(particles, clone)
			end
		end

		task.spawn(function()
			local elapsed = 0
			while elapsed < duration and humanoid.Health > 0 do
				if elapsed > duration or humanoid.Health < 0 then
					break
				end
				EffectModule.DealDamage(cause,char,damage)
			
				wait(timebetweendamage)
				elapsed += timebetweendamage
			end

			for _, particle in ipairs(particles) do
				if particle and particle.Parent then
					particle.Enabled = false
					wait()
					particle:Destroy()
				end
			end
		end)
	end
end

function EffectModule.DealDamage(char,echar,Dmg)
	echar.Humanoid:TakeDamage(Dmg)
	if not echar:FindFirstChild(char.Name.." Tag") then
		local tag = Instance.new("NumberValue")
		tag.Name = char.Name.." Tag"
		tag.Parent = echar
		tag.Value += Dmg
		game:GetService("Debris"):AddItem(tag,120)
	else
		echar:FindFirstChild(char.Name.." Tag").Value += Dmg
	end
	
end


function EffectModule.Stun(char, stunTime,CustomName)
	if stunTime and stunTime > 0 then
		task.spawn(function()

			local stuninstance = Instance.new("StringValue")
			stuninstance.Name = "Stunned"
			stuninstance.Parent = char
			task.wait(stunTime )
			stuninstance:Destroy()
			local Humanoidvalues = Instance.new("StringValue")
			Humanoidvalues.Name = "ResetHumanoidValues"
			Humanoidvalues.Parent = char
			game:GetService("Debris"):AddItem(Humanoidvalues,0.05)
		end)
	else
		local tag = 0
		for i,v in pairs(char:GetChildren()) do
			if v and v.Name == "Stunned" then
				if v:FindFirstChild(CustomName) then
					tag += 1
				end
			end
		end
		if tag <= 0 then
			local stuninstance = Instance.new("StringValue")
			stuninstance.Name = "Stunned"
			stuninstance.Parent = char
			local Inf = Instance.new("StringValue")
			Inf.Name = CustomName
			Inf.Parent = stuninstance
		else
			for i,v in pairs(char:GetChildren()) do
				if v and v.Name == "Stunned" then
					if v:FindFirstChild(CustomName) then
						v:Destroy()
					end
				end
			end
		end
		
	end
	

	
end



function EffectModule.KnockBack(char : CharacterMesh,Echar: CharacterMesh,powers)
	local humanoid : Humanoid = char and char.Humanoid
	local root = humanoid and humanoid.RootPart
	local ehumanoid : Humanoid = Echar and Echar.Humanoid
	local eroot = ehumanoid and ehumanoid.RootPart
	
	local bv = Instance.new("BodyVelocity",eroot)

	bv.MaxForce = Vector3.new(200000,200000,200000)

		bv.Velocity  = root.CFrame.LookVector * powers.straight + root.CFrame.UpVector * powers.Up
	
	game:GetService("Debris"):AddItem(bv,0.1)
	
end


function EffectModule.Ragdoll(char : Model, sec : number)
	-- this should be the regular
	-- if the seconds/duration is -1 it will not stop and until called again the ragdoll will not stop
	local humanoid = char:WaitForChild("Humanoid")
	local plr = game.Players:GetPlayerFromCharacter(char)
		local folder = Instance.new("Folder",char)
		folder.Name = "RagdollParts"
		local function ragdoll()
		if char:FindFirstChild("Ragdolled")  then
			return
		end
		EffectModule.Stun(char,-1,"Ragdoll")
		humanoid.AutoRotate = false
			local ragdolltag = Instance.new("StringValue")
		ragdolltag.Parent = char
			ragdolltag.Name = "Ragdolled"
			humanoid.BreakJointsOnDeath = false
			humanoid.PlatformStand = true 
			
			
			
			
			if not remote then return end
			
	


		

	

			if humanoid:GetState() ~= Enum.HumanoidStateType.Physics then

				for index, joint in pairs(char:GetDescendants()) do
					if joint:IsA("Part") or joint:IsA("MeshPart") or joint:IsA("BasePart") then
						joint.Massless = true
					end
					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
						
						if joint.Name == "Root" then
							socket:Destroy()
							local hinge = Instance.new("HingeConstraint")
							hinge.Parent = joint.Parent
							hinge.Attachment0 = a1
							hinge.Attachment1 = a2
							hinge.LimitsEnabled = true
						end
						if joint.Name == "Neck" then
							socket:Destroy()
							local hinge = Instance.new("HingeConstraint")
							hinge.Parent = joint.Parent
							hinge.Attachment0 = a1
							hinge.Attachment1 = a2
							hinge.LimitsEnabled = true
						end
						joint.Enabled = false
					if joint.Name == "Root" then
						joint.Enabled = true
					end
					end
				end
			for i,v in pairs(char:GetChildren()) do
				if v:IsA("Part") then

					local clone = v:Clone()
					clone.Parent = folder
					clone.Size *= 0.5
					clone.CollisionGroup = "RagdollLimbs"
					if clone:FindFirstChildOfClass("BodyVelocity") then
						clone:FindFirstChildOfClass("BodyVelocity"):Destroy()
					end
					local weld = Instance.new("Weld")
					weld.Parent = clone
					weld.Part0 = v
					weld.Part1 = clone
					clone.Transparency = 1

					clone.CanCollide = true
				end
			end
			if plr then
				
				remote:FireClient(plr, "Make", sec)
			else

				humanoid:ChangeState(Enum.HumanoidStateType.Physics)
			end
		
		end
		

			
			
		end
		local function unragdoll(ragdollwipe: boolean)
	
			if humanoid.Health > 0 then
			if not char:FindFirstChild("Ragdolled") then return end
			local stand =  char:FindFirstChildOfClass("Model") and char:FindFirstChildOfClass("Model"):FindFirstChildOfClass("Humanoid")
				task.spawn(function()
				-- Example:
				humanoid:SetStateEnabled(Enum.HumanoidStateType.Physics, false)
				if plr then


					remote:FireClient(plr, "Destroy", sec)

				else
	
					humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
					delay(task.wait(0.2),function()




						humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)

					end)

				end		
	
				for _, part in ipairs(char:GetDescendants()) do
					if part:IsA("BasePart") then
						part.AssemblyLinearVelocity = Vector3.zero
						part.AssemblyAngularVelocity = Vector3.zero
						part.RotVelocity = Vector3.zero
						part.Velocity = Vector3.zero
					end
				end

				for index, joint in pairs(char:GetDescendants()) do
					if joint:IsA("Part") or joint:IsA("MeshPart") or joint:IsA("BasePart") then
						joint.Massless = false
					end
					if   joint and  joint:IsA("Motor6D")  and joint.Part0 and joint.Part1 then
						local socket = joint.Parent:FindFirstChild("BallSocketConstraint") or joint.Parent:FindFirstChild("HingeConstraint")
						local a1= joint.Part0:FindFirstChild("Attachment")
						local a2= joint.Part1:FindFirstChild("Attachment")
						local tries = 0
				
						delay(0,function()
							if not a1 and not a2 then
								repeat
									task.wait()
									a1 = joint.Part0:FindFirstChild("Attachment")
									a2 = joint.Part1:FindFirstChild("Attachment")
									if not a1 and not a2 then
										tries += 1
									end
								until
								humanoid.Health <= 0 and a1 and  a2 or tries > 5
							end

							if a1 and a2 then
								socket:Destroy()
								a1:Destroy()
								a2:Destroy()	
							end
						end)
					
				
							joint.Enabled = true
					
					end
				end
				

				if char:FindFirstChild("RagdollParts") then
					char:FindFirstChild("RagdollParts"):Destroy()
				end
				if char:FindFirstChild("RagdollParts") then
					char:FindFirstChild("RagdollParts"):Destroy()
				end

				for _, constraint in pairs(char:GetDescendants()) do
					if constraint:IsA("BallSocketConstraint") or constraint:IsA("HingeConstraint") then
						constraint.Enabled = false
						
					end
				end
				

				
			
				if char:FindFirstChild("Ragdolled") then
					if ragdollwipe == false then
						char:FindFirstChild("Ragdolled"):Destroy()
					else
						for i,v in pairs(char:GetChildren()) do
							if v and v.Name == "Ragdolled" then
								v:Destroy()
							end
						end
					end

				end



		
			
				humanoid.AutoRotate = true
					
				humanoid.PlatformStand = false
				
			

				

				for _, part in ipairs(char:GetDescendants()) do
					if part:IsA("BasePart") then
						part.AssemblyLinearVelocity = Vector3.zero
						part.AssemblyAngularVelocity = Vector3.zero
						part.RotVelocity = Vector3.zero
						part.Velocity = Vector3.zero
					end
				end





			

				

				

				EffectModule.Stun(char,-1,"Ragdoll")
				
				if stand then
					if char:FindFirstChild("Head"):FindFirstChildOfClass("Motor6D") then
						for i,v in pairs(char:FindFirstChild("Head"):GetChildren()) do
							if v then
								if v:IsA("Motor6D") then
									if v:FindFirstChild("AbilityWeld") then
										local c = v:Clone()
										v:Destroy()
										
										delay(0.05,function()
											c.Parent = char:FindFirstChild("HumanoidRootPart")
										end)
									end
								end
							end
						end
						
					end
				end
				
				end)
			
			end
		end
		if humanoid then
		if sec and sec > -1   then


			ragdoll()
			task.delay(sec, unragdoll)
		else
			if humanoid.PlatformStand == true and char:FindFirstChild("Ragdolled")  then
				print("unrag")
				unragdoll()
			else

				ragdoll()
			end

		end
		end
		
	
	
end


return EffectModule


Ragdoll Cancel + Dash Script

local UIS = game:GetService('UserInputService')
local ReplicatedStorage = game:GetService("ReplicatedStorage")


local EffectModule = require(ReplicatedStorage.Modules.EffectModule)
local Hitbox = require(ReplicatedStorage.Modules.HitboxModule)
local ScreenShake = require(ReplicatedStorage.Modules.ScreenShake)
local RockVfx = require(ReplicatedStorage.Modules.VfxRockEffect)

local RemotesFolder = ReplicatedStorage:WaitForChild("Remotes")
local MoveRemote = RemotesFolder:WaitForChild("MoveRemote")


local Playercooldowns = {}
local punchanims = 
	{
		[1] = ReplicatedStorage.Animations.Combat.M1,
		[2] = ReplicatedStorage.Animations.Combat.M2,
		[3] = ReplicatedStorage.Animations.Combat.M3
	}


game.Players.PlayerRemoving:Connect(function(plr)
	Playercooldowns[plr] = nil
end)







game.ReplicatedStorage.Remotes.Combat.Event:Connect(function(plr,holdjump)
	local char = plr.Character
	if char and char.Humanoid.Health > 0 then
		local finisher

		if 				char:FindFirstChild("M1Streak").Value == 4 then
			print(holdjump)
			if holdjump == true and  char.Humanoid.FloorMaterial ~= Enum.Material.Air then
				finisher = "UpperCut"
			elseif   char.Humanoid.FloorMaterial == Enum.Material.Air then
				finisher = "Slam"
			elseif not holdjump or char.Humanoid.FloorMaterial ~= Enum.Material.Air then


				finisher = "Normal"
			end
		end
		local tag = Instance.new("StringValue")
		tag.Name = "UsingAbilityMove"
		tag.Parent = char

		if finisher then
			if finisher == "UpperCut" then
				local anim = char.Humanoid:LoadAnimation(game.ReplicatedStorage.Animations.Combat.Uppercut)
				anim:Play()
				local c
				local cancel= false
				c = char.ChildAdded:Connect(function(v)
					if v.Name == "Stunned" then
						cancel = true
						anim:Stop()

						if char:FindFirstChild("UsingAbilityMove")  then
							char:FindFirstChild("UsingAbilityMove"):Destroy()
						end
						if c then
							c:Disconnect()
						end

					end
				end)
				delay(task.wait(0.2),function()
					if cancel == true then
						return
					end
					if char:FindFirstChild("UsingAbilityMove")  then
						char:FindFirstChild("UsingAbilityMove"):Destroy()
					end
					local NewHitBox = Hitbox:CreateHitbox(Enum.PartType.Block,Vector3.new(5,5,8),2 ,0.1,false,true,false,char,char,char.HumanoidRootPart)
					local hit = NewHitBox:DetectHit()
					for i,v in pairs(hit) do
						if v then
							EffectModule.DealDamage(char,v,5)
					
						
							EffectModule.KnockBack(char,v,{["Up"] = 30,["straight"] = 5})
							EffectModule.Ragdoll(v,2)

						end
					end
					c:Disconnect()
				end)
			elseif finisher == "Normal" then
				local anim = char.Humanoid:LoadAnimation(punchanims[1])
				anim:Play()
				local c
				local cancel= false
				c = char.ChildAdded:Connect(function(v)
					if v.Name == "Stunned" then
						cancel = true
						anim:Stop()

						if char:FindFirstChild("UsingAbilityMove")  then
							char:FindFirstChild("UsingAbilityMove"):Destroy()
						end
						if c then
							c:Disconnect()
						end

					end
				end)
				delay(0.02,function()
					if cancel == true then
						return
					end
					if char:FindFirstChild("UsingAbilityMove")  then
						char:FindFirstChild("UsingAbilityMove"):Destroy()
					end
					local NewHitBox = Hitbox:CreateHitbox(Enum.PartType.Block,Vector3.new(5,5,8),2 ,0.1,false,true,false,char,char,char.HumanoidRootPart)
					local hit = NewHitBox:DetectHit()
					for i,v in pairs(hit) do
						if v then
							EffectModule.DealDamage(char,v,5)
							EffectModule.Ragdoll(v,2)
							EffectModule.KnockBack(char,v,{["Up"] = 0,["straight"] = 40})


						end
					end
					c:Disconnect()
				end)
			else
				local anim = char.Humanoid:LoadAnimation(game.ReplicatedStorage.Animations.Combat.Downslam)
				anim:Play()
				local c
				local cancel= false
				c = char.ChildAdded:Connect(function(v)
					if v.Name == "Stunned" then
						cancel = true
						anim:Stop()

						if char:FindFirstChild("UsingAbilityMove")  then
							char:FindFirstChild("UsingAbilityMove"):Destroy()
						end
						if c then
							c:Disconnect()
						end
						
					end
				end)
				
					if cancel == true then
						return
					end
					if char:FindFirstChild("UsingAbilityMove")  then
						char:FindFirstChild("UsingAbilityMove"):Destroy()
					end
					local NewHitBox = Hitbox:CreateHitbox(Enum.PartType.Block,Vector3.new(5,10,9),2 ,1,false,true,false,char,char,char.HumanoidRootPart,5)
					delay(task.wait(0.3),function()
					local hit = NewHitBox:DetectHit()
					print(hit)
					if hit then
						RockVfx.Vfxcircle(CFrame.new(char.HumanoidRootPart.Position + char.HumanoidRootPart.CFrame.LookVector * 2.5),2,15,5,1,2)
					end
					for i,v in pairs(hit) do
						if v then
							EffectModule.DealDamage(char,v,5)
	
							v.HumanoidRootPart.CFrame = 			CFrame.lookAt(v.HumanoidRootPart.Position, char.HumanoidRootPart.Position ) * CFrame.Angles(-80,0,0) 

	

							EffectModule.Ragdoll(v,2)
							local slam = Instance.new("BodyVelocity")
							slam.MaxForce = Vector3.new(0,-2000,0)
							slam.Parent = v:FindFirstChild("Torso")
							slam.Velocity = v.HumanoidRootPart.CFrame.UpVector * -2000
							game:GetService("Debris"):AddItem(slam,0.1)

						end
					end
					c:Disconnect()
					end)
		
			end
		else
			local anim = char.Humanoid:LoadAnimation(punchanims[char:FindFirstChild("M1Streak").Value])
			anim:Play()
			local c
			local cancel= false
			c = char.ChildAdded:Connect(function(v)
				if v.Name == "Stunned" then
					cancel = true
					anim:Stop()

					if char:FindFirstChild("UsingAbilityMove")  then
						char:FindFirstChild("UsingAbilityMove"):Destroy()
					end
					if c then
						c:Disconnect()
					end

				end
			end)
			delay(task.wait(0.02),function()
				if char:FindFirstChild("UsingAbilityMove")  then
					char:FindFirstChild("UsingAbilityMove"):Destroy()
				end
				if cancel == true then
					return
				end

				local NewHitBox = Hitbox:CreateHitbox(Enum.PartType.Block,Vector3.new(5,5,8),2 ,1,false,true,false,char,char,char.HumanoidRootPart)
				local hit = NewHitBox:DetectHit()
				for i,v in pairs(hit) do
					if v then
						EffectModule.DealDamage(char,v,2)
						EffectModule.Stun(v,0.8)
						EffectModule.KnockBack(char,v,{["Up"] = 0,["straight"] = 5})
						EffectModule.KnockBack(char,char,{["Up"] = 0,["straight"] = 5})
					end
				end
				c:Disconnect()
			end)

		end



	end


end)

game.ReplicatedStorage.Remotes.Dash.Event:Connect(function(plr,direction)
	local char = plr.Character
	local hrp = char:FindFirstChild("HumanoidRootPart")
	if char and char.Humanoid.Health > 0 then
		local tag = Instance.new("StringValue")
		tag.Parent = hrp
		tag.Name = "Dashing"

		local bodyvelocity = Instance.new("BodyVelocity")
		bodyvelocity.Parent = hrp
		bodyvelocity.MaxForce = Vector3.new(150000,1,150000)
		local c 
		local cancel
		print("er")
		c = char.ChildAdded:Connect(function(v)
			if v.Name == "Stunned" then
				cancel = true
				

				if bodyvelocity  then
					bodyvelocity:Destroy()
				end
				if c then
					c:Disconnect()
				end

			end
		end)
	
		if direction == "Left" or direction == "Right" then

				game:GetService("Debris"):AddItem(tag,(0.5))
			
				for i = 30,0,-1 do
					
					if not hrp:FindFirstChild(tag.Name) then
						break
					end
					if bodyvelocity then
					if  direction == "Left" then

						bodyvelocity.Velocity = hrp.CFrame.RightVector * -i *4
					else

						bodyvelocity.Velocity = hrp.CFrame.RightVector * i *4
					end
					end
					
				
					task.wait(0.00001)
				end
				
		elseif direction == "Front" then
			local HitboxThing = Hitbox:WeldedHitbox(Enum.PartType.Block,Vector3.new(5.929, 7.965,7),0,999,false,char,char)
			local hit
			local connection2 
			local finished = false
			
			
			connection2 = HitboxThing.Hitbox.Touched:Connect(function(part)
				if part.Parent:FindFirstChildOfClass("Humanoid") and  part.Parent ~= char then
					hit = part.Parent
					local realhit = HitboxThing:DetectHit({},true,hit)
					if #realhit ~= 0 then
						char.HumanoidRootPart.Anchored =  true
						delay(task.wait(0.1),function()
							char.HumanoidRootPart.Anchored =  false
						end)

						finished = true
						if tag then
							tag:Destroy()
						end
						if bodyvelocity then
							bodyvelocity:Destroy()
						end
					for i,v in pairs(realhit) do
						EffectModule.DealDamage(char,v,3)
						EffectModule.Stun(v,0.5)


				
					end

					end
					HitboxThing:HitboxDestroy(0)
					if connection2 then
						connection2:Disconnect()
					end
				end
			end)
			

			
			for i = 40,0,-1 do
				if not hrp:FindFirstChild(tag.Name) then
				
					break
				end
			
		
				delay(task.wait(0.0001),function()
					
					if not finished and bodyvelocity then
						bodyvelocity.Velocity = hrp.CFrame.LookVector * i * 2
					elseif finished and bodyvelocity then
						hrp.AssemblyLinearVelocity = Vector3.new(0,0,0)
						bodyvelocity.Velocity = hrp.CFrame.LookVector * 0
					
					end
				

				end)
				task.wait()
	
			end
			if  connection2 then
				connection2:Disconnect()
			end
			if HitboxThing and not finished then
				pcall(function()
					HitboxThing:HitboxDestroy(0)
				end)
			
			end
		elseif direction == "Back" then
			
			for i = 50,0,-1 do
				if not tag then
					break
				end
				if bodyvelocity then
					bodyvelocity.Velocity = hrp.CFrame.LookVector * -i
				end
		

				task.wait(0.001)
			end
		
		end
		if tag then
			tag:Destroy()
		end
		if c then
			c:Disconnect()
		end
		if bodyvelocity then
			bodyvelocity:Destroy()
		end

		
	


		
	end

end)

MoveRemote.OnServerEvent:Connect(function(plr, Num,ExtraInfo)
	if plr.Character and plr.Character:FindFirstChild("HumanoidRootPart") and  plr.Character.Humanoid.Health > 0 and not plr.Character:FindFirstChild("InCutscene")  and not plr.Character:FindFirstChild("UsingAbilityMove") and not plr.Character:FindFirstChild("HumanoidRootPart"):FindFirstChild("Dashing") then
		local ticks = os.clock()
		local playerCooldownstable = Playercooldowns[plr] or {}


		local lastused 
	
		if not plr.Character:FindFirstChild("Ragdolled")  and  not plr.Character:FindFirstChild("Stunned") and  ExtraInfo.Type ~= "Dashes"  then
			


			if ExtraInfo.Type and ExtraInfo.Type == "M1" then
				lastused = playerCooldownstable["M1"] or 0
				local lastused2 = playerCooldownstable["M1CoolDown"] or 0
				local cooldown
				if plr.Character:FindFirstChild("M1Streak").Value == 4 then
					cooldown = 1.5
				else
					cooldown = 0.8
				end
				if ticks - lastused2 > cooldown then
					if ticks - lastused <= 2 then
						if plr.Character:FindFirstChild("M1Streak").Value > 3 then
							plr.Character:FindFirstChild("M1Streak").Value = 1

						else

							plr.Character:FindFirstChild("M1Streak").Value += 1
						end

					else
						plr.Character:FindFirstChild("M1Streak").Value = 1
					end
					local m1tag = Instance.new("StringValue")
					m1tag.Parent = plr.Character
					m1tag.Name = "M1"
					game:GetService("Debris"):AddItem(m1tag,1)
					RemotesFolder.Combat:Fire(plr,ExtraInfo.Jumping)

					playerCooldownstable["M1"] = ticks
					playerCooldownstable["M1CoolDown"] = ticks
					Playercooldowns[plr] = playerCooldownstable
				end
			
			elseif ExtraInfo.Type and ExtraInfo.Type == "DeathAwakening" then
				print("ea")
				local ic = Instance.new("StringValue",plr.Character)
				ic.Name = "InCutscene"
				local stayinplace = Instance.new("BodyVelocity",plr.Character.HumanoidRootPart)
				stayinplace.MaxForce = Vector3.new(1e9,0,1e9)
				stayinplace.Velocity = Vector3.new(0,0,0)


				local animation = plr.Character.Humanoid:LoadAnimation(game.ReplicatedStorage.Animations.PlrAnimations.Ctda)
				animation:Play()

				local quicktimeevent = game.ReplicatedStorage.Remotes.QuickTimeEvent:InvokeClient(plr)
				animation:Stop()
				if quicktimeevent == true then
					stayinplace:Destroy()
					plr.Character.Humanoid.Health += 25
					local moduletest = require(ReplicatedStorage.MoveSets:FindFirstChild(plr.Character:FindFirstChild("Ability").Value))
					moduletest:DeathAwakening(plr)
					local deathstring = Instance.new("StringValue")
					deathstring.Name = "CloseToDeathAwakening"
					deathstring.Parent = plr.Character
					ic:Destroy()

				else

					MoveRemote:FireClient(plr, "Shake",{Duration = 0.1,intensity = 50})
					stayinplace:Destroy()
					ic:Destroy()
					EffectModule.Stun(plr.Character,4)
				end

			else
				lastused = playerCooldownstable[Num] or 0
				local moduletest = require(ReplicatedStorage.MoveSets:FindFirstChild(plr.Character:FindFirstChild("Ability").Value))
				print(ticks - lastused)



				if ticks - lastused > moduletest.MoveSet[Num].CoolDown then



					delay(0,function()
						while task.wait() do
							if not plr.Character:FindFirstChild("UsingAbilityMove") then
								break
							end
						end
						playerCooldownstable[Num] = ticks
						Playercooldowns[plr] = playerCooldownstable
						MoveRemote:FireClient(plr,Num,moduletest.MoveSet[Num].CoolDown)
					end)

					moduletest:Decision(plr,Num,ExtraInfo)
					plr.Character:FindFirstChild("AbilityUsage").Value -= moduletest.MoveSet[Num].EnergyComp

					if plr.Character:FindFirstChild("AbilityUsage").Value <= 0 then
						moduletest:Despawn(plr)
					end


				end
			end
		elseif ExtraInfo.Type == "Dashes"  then
			local stunnedforreal = false
			for i,v in pairs(plr.Character:GetChildren()) do
				if v and v.Name == "Stunned" then
					if not v:FindFirstChild("Ragdoll") then
						stunnedforreal = true
					end
				end
			end
			if stunnedforreal == false and plr.Character:FindFirstChild("Ragdolled")  or  stunnedforreal == false and not  plr.Character:FindFirstChild("Ragdolled") then
				
			
			if ExtraInfo.Type and ExtraInfo.Type == "Dashes" then



				if ExtraInfo.TypeOfDash == "Left" or ExtraInfo.TypeOfDash == "Right"  then
					lastused = playerCooldownstable["SideDash"] or 0
					local lastused2 = playerCooldownstable["RagdollDash"] or 0
					if ticks - lastused >= 3 and not plr.Character:FindFirstChild("Dashing") then
						if plr.Character:FindFirstChild("Ragdolled")   then
							print("yes")
								if  ticks - lastused2 >= 15  then
									print("may be")
									for _, part in ipairs(plr.Character:GetDescendants()) do
										if part:IsA("BasePart") then
											part.AssemblyLinearVelocity = Vector3.zero
											part.AssemblyAngularVelocity = Vector3.zero
											part.RotVelocity = Vector3.zero
											part.Velocity = Vector3.zero
										end
									end


									EffectModule.Ragdoll(plr.Character,-1)

									playerCooldownstable["RagdollDash"] = ticks
									Playercooldowns[plr] = playerCooldownstable
									for _, part in ipairs(plr.Character:GetDescendants()) do
										if part:IsA("BasePart") then
											part.AssemblyLinearVelocity = Vector3.zero
											part.AssemblyAngularVelocity = Vector3.zero
											part.RotVelocity = Vector3.zero
											part.Velocity = Vector3.zero
										end
									end


									task.wait(0.15)

								else
									print("maybe")
									return
								end
				
								
							
					
						end
							
								print("e")
								game.ReplicatedStorage.Remotes.Dash:Fire(plr,ExtraInfo.TypeOfDash)
								playerCooldownstable["SideDash"] = ticks
								Playercooldowns[plr] = playerCooldownstable
							
					
	
					end

				elseif ExtraInfo.TypeOfDash == "Back" then
					lastused = playerCooldownstable["FrontAndBack"] or 0
						local lastused2 = playerCooldownstable["RagdollDash"] or 0
					if ticks - lastused >= 5 and not plr.Character:FindFirstChild("Dashing") then
						print("e")
							if plr.Character:FindFirstChild("Ragdolled")   then
								print("yes")
								if  ticks - lastused2 >= 15  then
									print("may be")
									for _, part in ipairs(plr.Character:GetDescendants()) do
										if part:IsA("BasePart") then
											part.AssemblyLinearVelocity = Vector3.zero
											part.AssemblyAngularVelocity = Vector3.zero
											part.RotVelocity = Vector3.zero
											part.Velocity = Vector3.zero
										end
									end
									

									EffectModule.Ragdoll(plr.Character,-1)
									
									playerCooldownstable["RagdollDash"] = ticks
									Playercooldowns[plr] = playerCooldownstable
									for _, part in ipairs(plr.Character:GetDescendants()) do
										if part:IsA("BasePart") then
											part.AssemblyLinearVelocity = Vector3.zero
											part.AssemblyAngularVelocity = Vector3.zero
											part.RotVelocity = Vector3.zero
											part.Velocity = Vector3.zero
										end
									end
							
			
									task.wait(0.15)
								
								else
									print("maybe")
									return
								end




							end

						game.ReplicatedStorage.Remotes.Dash:Fire(plr,ExtraInfo.TypeOfDash)
						playerCooldownstable["FrontAndBack"] = ticks
						Playercooldowns[plr] = playerCooldownstable
					end

				else
					lastused = playerCooldownstable["FrontAndBack"] or 0
					if ticks - lastused >= 5 and not plr.Character:FindFirstChild("Dashing") then
						print("e")
						game.ReplicatedStorage.Remotes.Dash:Fire(plr,ExtraInfo.TypeOfDash)
						playerCooldownstable["FrontAndBack"] = ticks
						Playercooldowns[plr] = playerCooldownstable
					end


				end
				end
				end

		end
		
		
	

		

	end
end)




have you tried disabling the humanoidrootpart’s RootJoint and then enabling it right after? (when the rig ragdolls)

I don’t think so,
Ill try that

Nevermind I checked back and I have done that

I actually found this and used it, it isnt smooth but will work fine
They just used cframe

i have unmarked it as today it does not work anymore for some reason

I have recreated it and now it wworks

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