Why do I crash on death?

Every time I reset or get killed I crash, I know this is caused by BreakJointsOnDeath because when I enabled it I started crashing every time I reset or get killed.

Could you show us some code? Of what the script looks like?

I have 2 scripts that mess with the BreakJointsOnDeath option. Both are below.

local head = script.Parent.Head
local leftarm = script.Parent["Left Arm"]
local leftleg = script.Parent["Left Leg"]
local rightleg = script.Parent["Right Leg"]
local rightarm = script.Parent["Right Arm"]
local torso = script.Parent.Torso
local player = game.Players:GetPlayerFromCharacter(script.Parent)
colliderll = Instance.new("Part", leftleg)
colliderll.Position = Vector3.new(0,999,0)
colliderll.Size = Vector3.new(1.5, 1, 1)
colliderll.Shape = "Block" --collision
local weld = Instance.new("Weld", colliderll)
weld.Part0 = leftleg
weld.Part1 = colliderll
weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
colliderll.TopSurface = "Smooth"
colliderll.BottomSurface = "Smooth"
colliderll.formFactor = "Symmetric"
colliderll.Transparency=1
local nocol = Instance.new("NoCollisionConstraint", colliderll)
nocol.Part0=colliderll
nocol.Part1=leftleg
nocol.Enabled=true
colliderll.CanCollide = false
--local nocolT = Instance.new("NoCollisionConstraint", torso)
--nocolT.Part0=torso
--nocolT.Part1=collider
--nocolT.Enabled=true

colliderrl = Instance.new("Part", rightleg)
colliderrl.Position = Vector3.new(0,999,0)
colliderrl.Size = Vector3.new(1.5, 1, 1)
colliderrl.Shape = "Block" --collision
local weld = Instance.new("Weld", colliderrl)
weld.Part0 = rightleg
weld.Part1 = colliderrl
weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
colliderrl.TopSurface = "Smooth"
colliderrl.BottomSurface = "Smooth"
colliderrl.formFactor = "Symmetric"
colliderrl.Transparency=1
local nocol = Instance.new("NoCollisionConstraint", colliderrl)
nocol.Part0=colliderrl
nocol.Part1=rightleg
nocol.Enabled=true
colliderrl.CanCollide = false
--local nocolT = Instance.new("NoCollisionConstraint", torso)
--nocolT.Part0=torso
--nocolT.Part1=collider
--nocolT.Enabled=true

colliderra = Instance.new("Part", rightarm)
colliderra.Position = Vector3.new(0,999,0)
colliderra.Size = Vector3.new(1.5, 1, 1)
colliderra.Shape = "Block" --collision
local weld = Instance.new("Weld", colliderra)
weld.Part0 = rightarm
weld.Part1 = colliderra
weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
colliderra.TopSurface = "Smooth"
colliderra.BottomSurface = "Smooth"
colliderra.formFactor = "Symmetric"
colliderra.Transparency=1
local nocol = Instance.new("NoCollisionConstraint", colliderra)
nocol.Part0=colliderra
nocol.Part1=rightarm
nocol.Enabled=true
colliderra.CanCollide = false
--local nocolT = Instance.new("NoCollisionConstraint", torso)
--nocolT.Part0=torso
--nocolT.Part1=collider
--nocolT.Enabled=true

colliderla = Instance.new("Part", leftarm)
colliderla.Position = Vector3.new(0,999,0)
colliderla.Size = Vector3.new(1.5, 1, 1)
colliderla.Shape = "Block" --collision
local weld = Instance.new("Weld", colliderla)
weld.Part0 = leftarm
weld.Part1 = colliderla
weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
colliderla.TopSurface = "Smooth"
colliderla.BottomSurface = "Smooth"
colliderla.formFactor = "Symmetric"
colliderla.Transparency=1
local nocol = Instance.new("NoCollisionConstraint", colliderla)
nocol.Part0=colliderla
nocol.Part1=leftarm
nocol.Enabled=true
colliderla.CanCollide = false
--local nocolT = Instance.new("NoCollisionConstraint", torso)
--nocolT.Part0=torso
--nocolT.Part1=collider
--nocolT.Enabled=true

local HeadA = Instance.new("Attachment")
HeadA.Name = "HeadA"
HeadA.Parent = head
HeadA.Position = Vector3.new(0, -0.5, 0)
HeadA.Axis = Vector3.new(1, 0, 0)
HeadA.SecondaryAxis = Vector3.new(0, 1, 0)

local LeftArmA = Instance.new("Attachment")
LeftArmA.Name = "LeftArmA"
LeftArmA.Parent = leftarm
LeftArmA.Position = Vector3.new(0, 0.6, 0)
LeftArmA.Axis = Vector3.new(1, 0, 0)
LeftArmA.SecondaryAxis = Vector3.new(0, 1, 0)

local LeftLegA = Instance.new("Attachment")
LeftLegA.Name = "LeftLegA"
LeftLegA.Parent = leftleg
LeftLegA.Position = Vector3.new(0, 1, 0)
LeftLegA.Axis = Vector3.new(1, 0, 0)
LeftLegA.SecondaryAxis = Vector3.new(1, 0, 0)

local RightArmA = Instance.new("Attachment")
RightArmA.Name = "RightArmA"
RightArmA.Parent = rightarm
RightArmA.Position = Vector3.new(0, 0.6, 0)
RightArmA.Axis = Vector3.new(1, 0, 0)
RightArmA.SecondaryAxis = Vector3.new(0, 1, 0)

local RightLegA = Instance.new("Attachment")
RightLegA.Name = "RightLegA"
RightLegA.Parent = rightleg
RightLegA.Position = Vector3.new(0, 1, 0)
RightLegA.Axis = Vector3.new(1, 0, 0)
RightLegA.SecondaryAxis = Vector3.new(0, 1, 0)

local TorsoA = Instance.new("Attachment")
TorsoA.Name = "TorsoA"
TorsoA.Parent = torso
TorsoA.Position = Vector3.new(0, 1, 0)
TorsoA.Axis = Vector3.new(1, 0, 0)
TorsoA.SecondaryAxis = Vector3.new(0, 1, 0)

local TorsoA1 = Instance.new("Attachment")
TorsoA1.Name = "TorsoA1"
TorsoA1.Parent = torso
TorsoA1.Position = Vector3.new(-0.5, -1, 0)
TorsoA1.Axis = Vector3.new(1, 0, 0)
TorsoA1.SecondaryAxis = Vector3.new(0, 1, 0)

local TorsoA2 = Instance.new("Attachment")
TorsoA2.Name = "TorsoA2"
TorsoA2.Parent = torso
TorsoA2.Position = Vector3.new(-1.5, 0.5, 0)
TorsoA2.Axis = Vector3.new(1, 0, 0)
TorsoA2.SecondaryAxis = Vector3.new(0, 1, 0)

local TorsoA3 = Instance.new("Attachment")
TorsoA3.Name = "TorsoA3"
TorsoA3.Parent = torso
TorsoA3.Position = Vector3.new(1.5, 0.5, 0)
TorsoA3.Axis = Vector3.new(1, 0, 0)
TorsoA3.SecondaryAxis = Vector3.new(0, 1, 0)

local TorsoA4 = Instance.new("Attachment")
TorsoA4.Name = "TorsoA4"
TorsoA4.Parent = torso
TorsoA4.Position = Vector3.new(0, 1, 0)
TorsoA4.Axis = Vector3.new(1, 0, 0)
TorsoA4.SecondaryAxis = Vector3.new(0, 1, 0)

local TorsoA5 = Instance.new("Attachment")
TorsoA5.Name = "TorsoA5"
TorsoA5.Parent = torso
TorsoA5.Position = Vector3.new(0.5, -1, 0)
TorsoA5.Axis = Vector3.new(1, 0, 0)
TorsoA5.SecondaryAxis = Vector3.new(0, 1, 0)

	local HA = Instance.new("BallSocketConstraint")
	HA.Parent = head
	HA.Attachment0 = HeadA
	HA.Attachment1 = TorsoA4
	HA.Enabled = true
	HA.LimitsEnabled = true
	HA.TwistLimitsEnabled = true
	HA.Restitution = 0
	HA.UpperAngle = 2
	HA.TwistLowerAngle = 0
	HA.TwistUpperAngle = 0
	HA.Name = "neck"
	
	local LAT = Instance.new("BallSocketConstraint")
	LAT.Parent = leftarm
	LAT.Attachment0 = LeftArmA
	LAT.Attachment1 = TorsoA2
	LAT.Enabled = true
	LAT.LimitsEnabled = true
	LAT.TwistLimitsEnabled = false
	LAT.Restitution = 0
	LAT.UpperAngle = 90
	LAT.Name = "shoulder"
	
	
	local RAT = Instance.new("BallSocketConstraint")
	RAT.Parent = rightarm
	RAT.Attachment0 = RightArmA
	RAT.Attachment1 = TorsoA3
	RAT.Enabled = true
	RAT.LimitsEnabled = true
	RAT.TwistLimitsEnabled = false
	RAT.Restitution = 0
	RAT.UpperAngle = 90
	RAT.Name = "shoulder"
	
	local TLL = Instance.new("BallSocketConstraint")
	TLL.Parent = torso
	TLL.Attachment0 = TorsoA1
	TLL.Attachment1 = LeftLegA
	TLL.Enabled = true
	TLL.LimitsEnabled = true
	TLL.TwistLimitsEnabled = false
	TLL.Restitution = 0
	TLL.UpperAngle = 90
	TLL.Name = "lhip"
	
	local TRL = Instance.new("BallSocketConstraint")
	TRL.Parent = torso
	TRL.Attachment0 = TorsoA5
	TRL.Attachment1 = RightLegA
	TRL.Enabled = true
	TRL.LimitsEnabled = true
	TRL.TwistLimitsEnabled = false
	TRL.Restitution = 0
	TRL.UpperAngle = 90
	TRL.Name = "rhip"

-- Scripted by Corktail
script.Parent.Humanoid.BreakJointsOnDeath = true
name="Humanoid"
--
--if true then
--	if false then
--	end
--end

local stunmeter = Instance.new("NumberValue",script.Parent.Humanoid)
stunmeter.Name = "SHealth"
stunmeter.Value=100


while wait() do
	
	if stunmeter.Value<25 or script.Parent.Humanoid.Health<=0.5 then
--		script.Parent.Humanoid:ChangeState("Freefall")		
		 wait(0.0001)
		if script.Parent:findFirstChild("Torso"):findFirstChild("Neck").Part0 ~= nil then
script.Parent:findFirstChild("Torso"):findFirstChild("Left Shoulder").Part0 = nil
script.Parent:findFirstChild("Torso"):findFirstChild("Right Shoulder").Part0 = nil
script.Parent:findFirstChild("Torso"):findFirstChild("Left Hip").Part0 = nil
script.Parent:findFirstChild("Torso"):findFirstChild("Right Hip").Part0 = nil
script.Parent:findFirstChild("Torso"):findFirstChild("Neck").Part0 = nil
colliderla.CanCollide=true
colliderra.CanCollide=true
colliderll.CanCollide=true
colliderrl.CanCollide=true
script.Parent.Humanoid.PlatformStand = true
script.Parent.Humanoid.Jump = false
end
if stunmeter.Value<25 then
	stunmeter.Value = stunmeter.Value + 1
		if player.TeamColor == BrickColor.new("Forest green") then
		stunmeter.Value = stunmeter.Value + 1
	end
	wait(0.5)
	if stunmeter.Value<0 then
		stunmeter.Value=1
	end
end
	else
script.Parent:findFirstChild("Torso"):findFirstChild("Left Shoulder").Part0 = script.Parent:findFirstChild("Torso")
script.Parent:findFirstChild("Torso"):findFirstChild("Right Shoulder").Part0 = script.Parent:findFirstChild("Torso")
script.Parent:findFirstChild("Torso"):findFirstChild("Left Hip").Part0 = script.Parent:findFirstChild("Torso")
script.Parent:findFirstChild("Torso"):findFirstChild("Right Hip").Part0 = script.Parent:findFirstChild("Torso")
script.Parent:findFirstChild("Torso"):findFirstChild("Neck").Part0 = script.Parent:findFirstChild("Torso")
colliderla.CanCollide=false
colliderra.CanCollide=false
colliderll.CanCollide=false
colliderrl.CanCollide=false
script.Parent.Humanoid.PlatformStand = false
if stunmeter.Value>=25 then
	stunmeter.Value = stunmeter.Value + 0.35
	if player.TeamColor == BrickColor.new("Forest green") then
		stunmeter.Value = stunmeter.Value + 0.75
	end
	wait(0.5)
	if stunmeter.Value>100 then
		stunmeter.Value=100
	end
end
--script.Parent.Humanoid:ChangeState("GettingUp")	

--script.Parent:findFirstChild("Head"):findFirstChild("face").Texture = "http://www	
end

end
repeat
	script.Parent.Parent = workspace:WaitForChild("ignore")
	script.Parent.Humanoid.RequiresNeck = false
	wait(0.1)
until script.Parent.Parent == workspace:WaitForChild("ignore")

local Humanoid = script.Parent:WaitForChild("Humanoid")

Humanoid.RequiresNeck = false

local DownedIdle = Humanoid:LoadAnimation(script:WaitForChild("Downed"))
local DownedMove = Humanoid:LoadAnimation(script:WaitForChild("DownedMove"))

local Hstub2 = game.ServerStorage.Stubs.HeadStub:Clone()

local Screams = {212389449, 475550904, 610708966, 610707342, 607516423}

local Gores = {429400881, 3739363791, 264486467, 245186002}

local LAOff = false
local RAOff = false
local LLOff = false
local RLOff = false
local HOff = false
local NBroke = false
local CanDown = true

local Coughed = 0

local Dead = false

local Falling = false

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Blood = require(ReplicatedStorage.Modules:WaitForChild("Blood"))

local Attachments = ReplicatedStorage:WaitForChild("BloodAttachments"):Clone()

Attachments.Anchored = false

Attachments.CFrame = script.Parent:WaitForChild("Torso").CFrame

Attachments.Parent = script.Parent:WaitForChild("HumanoidRootPart")

local AttachmentsWeld = Instance.new("Weld", Attachments)
AttachmentsWeld.Part0 = Attachments
AttachmentsWeld.Part1 = script.Parent:WaitForChild("Torso")


function Ragdoll(Hum)
	local c = Hum.Parent
	c.Humanoid.BreakJointsOnDeath = false
	c.PlayerStuff.Values.Ragdolled.Value = true
	Hum.PlatformStand = true
	Hum.AutoRotate = false
	Hum.JumpHeight = 0
	for _, v in pairs(c:GetDescendants()) do
		if v:IsA("Tool") then
			tool = v 
		end
	end 
	Hum.Parent.PlayerStuff.Events.HideInv:FireAllClients()
	Hum:UnequipTools()
	Hum:ChangeState(Enum.HumanoidStateType.GettingUp)
	for _, v in pairs(c:GetDescendants()) do
		if v:IsA("Motor6D") and v.Name ~= "Root Hip" and v.Name ~= "RootJoint" and v.Name ~= "ToolMotor" then
			local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
			a0.CFrame = v.C0
			a1.CFrame = v.C1
			a0.Parent = v.Part0
			a1.Parent = v.Part1

			local b = Instance.new("BallSocketConstraint")
			b.LimitsEnabled = true
			b.Radius = 10
			b.Attachment0 = a0
			b.Attachment1 = a1
			b.Parent = v.Part1

			if string.match(b.Parent.Name, "Arm") then
				b.UpperAngle = 90
				b.TwistLowerAngle = -90
				b.TwistUpperAngle = 90
				b.Attachment0.Axis = Vector3.new(1,0,0)
				b.Attachment0.SecondaryAxis = Vector3.new(0,1,0)
				b.Attachment1.Axis = Vector3.new(1,0,0)
				b.Attachment1.SecondaryAxis = Vector3.new(0,1,0)
			elseif string.match(b.Parent.Name, "Leg") then
				b.UpperAngle = 35
				b.TwistLowerAngle = -90
				b.TwistUpperAngle = 90
				b.Attachment0.Axis = Vector3.new(1,0,0)
				b.Attachment0.SecondaryAxis = Vector3.new(0,0,0)
				b.Attachment1.Axis = Vector3.new(1,0,0)
				b.Attachment1.SecondaryAxis = Vector3.new(0,0,0)
			elseif string.match(b.Parent.Name, "Head") then
				b.UpperAngle = 55
				b.TwistLowerAngle = -75
				b.TwistUpperAngle = 45
				b.Attachment0.Axis = Vector3.new(1,0,0)
				b.Attachment0.SecondaryAxis = Vector3.new(0,1,0)
				b.Attachment1.Axis = Vector3.new(1,0,0)
				b.Attachment1.SecondaryAxis = Vector3.new(0,1,0)
			end

			local Part = Instance.new("Part", v.Part1)
			Part.Size = v.Part1.Size - Vector3.new(0.25,0.5,0.25)
			Part.Name = "Collider"
			Part.CFrame = v.Part1.CFrame
			Part.Transparency = 1



			local Weld = Instance.new("Weld", Part)
			Weld.Part0 = Part
			Weld.Part1 = v.Part1

			v.Enabled = false
		end
	end
	local HumanoidRootPart = c:FindFirstChild("HumanoidRootPart")
	local Torso = c:FindFirstChild("Torso")
	local Head = c:FindFirstChild("Head")
	if HumanoidRootPart then
		HumanoidRootPart.CanCollide = false
	else
	end
end

function Unragdoll(Hum)
	local c = Hum.Parent
	if Hum.Health > 0 and not c.PlayerStuff.Values.BleedingOut.Value == true then
		Hum.PlatformStand = false
	end
	Hum.AutoRotate = true
	Hum.JumpHeight = 4
	Hum.Jump = true
	c.PlayerStuff.Values.Ragdolled.Value = false
	if not tool == nil then
		Hum:EquipTool(tool)
	else
		tool = nil
	end
	for _, v in pairs(c:GetDescendants()) do
		if v:IsA("PointLight") and v.Name == "DownedLight" then
			v:Destroy()
		end
	end
	for _, v in pairs(c:GetDescendants()) do
		if v:IsA("Motor6D") then
			v.Enabled = true
		end
	end
	for _, v in pairs(c:GetDescendants()) do
		if v:IsA("BallSocketConstraint") then
			if v.Attachment0 then
				v.Attachment0:Destroy()
			else
			end
			if v.Attachment1 then
				v.Attachment1:Destroy()
			else
			end
			if v then
				v:Destroy()
			else
			end
		end
	end
	for _, v in pairs(c:GetDescendants()) do
		if v:IsA("BasePart") and v.Name == "Collider" then
			v:Destroy()
		end
	end
	local HumanoidRootPart = c:FindFirstChild("HumanoidRootPart")
	local Torso = c:FindFirstChild("Torso")
	local Head = c:FindFirstChild("Head")
	if HumanoidRootPart then
		HumanoidRootPart.CanCollide = true
	else
		return
	end
end

local Downed = false

local BleedingOut = false

local DownedDebounce = false

Humanoid.Died:Connect(function()
	if not Dead then
		Dead = true
		Downed = false
		BleedingOut = false
		Humanoid.Parent.PlayerStuff.Values.Downed.Value = false
		print("Died")
		Ragdoll(Humanoid)
		local DeathGui = game.ReplicatedStorage.DeathGui:Clone()
		DeathGui.Parent = script.Parent:WaitForChild("Torso")
		local DownedLight = script.Parent:WaitForChild("HumanoidRootPart"):FindFirstChild("DownedLight")
		if DownedLight then
			DownedLight.Color = Color3.fromRGB(255, 0, 0)
			DownedLight.Range = 7
		else
		end
		while Dead do
			wait()
			for _, v in pairs(Humanoid.Parent:GetDescendants()) do
				if v.Name == "BleedGui" or v.Name == "DownedGui" or v.Name == "Breathing" then
					v:Destroy()
				end
			end
		end
	else
	end
end)


Humanoid.HealthChanged:Connect(function(Health)
	if Health <= 15 and not Downed and not DownedDebounce and not Dead and not BleedingOut and not NBroke and CanDown == true then
		DownedDebounce = true
		delay(1, function()
			DownedDebounce = false
		end)
		Ragdoll(Humanoid)
		Downed = true
		Humanoid.Parent.PlayerStuff.Values.Downed.Value = true
		Humanoid.Parent.Health.Disabled = true
		Humanoid.Parent.Limp.Disabled = true 
		game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)

		local DownedGui = game.ReplicatedStorage.DownedGui:Clone()
		DownedGui.Parent = script.Parent:WaitForChild("HumanoidRootPart")
		DownedGui.PlayerToHideFrom = game.Players:GetPlayerFromCharacter(game.Players:WaitForChild(script.Parent.Name))

		local DownedLight = Instance.new("PointLight", script.Parent:WaitForChild("HumanoidRootPart"))
		DownedLight.Brightness = 5
		DownedLight.Range = 5
		DownedLight.Color = Color3.fromRGB(255, 170, 127)
		DownedLight.Name = "DownedLight" 
		game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)

		Humanoid.HealthChanged:Connect(function()
			if Downed and CanDown and not NBroke then
				local color1 = Color3.fromRGB(255,180,0);
				local color2 = Color3.fromRGB(100,7,7);

				local newColor = color2:lerp(color1, Humanoid.Health/Humanoid.MaxHealth);

				script.Parent:WaitForChild("HumanoidRootPart").DownedGui.Frame.ImageLabel.ImageColor3 = newColor
			else
			end
		end)
		Humanoid.Health = Humanoid.MaxHealth

		DownedMove:AdjustSpeed(0)

		wait(2)
		if Humanoid.Health > 0 and Downed == true and CanDown == true then
			Unragdoll(Humanoid)
			Humanoid.Parent:WaitForChild("Torso").CFrame = CFrame.new (Humanoid.Parent:WaitForChild("Torso").Position) * CFrame.Angles (0, math.rad (90), 0)
			DownedMove:Play()
			DownedMove:AdjustSpeed(0)
			Humanoid.JumpHeight = 0
			Humanoid.Parent.PlayerStuff.Events.HideInv:FireAllClients()
			Humanoid.WalkSpeed = Humanoid.WalkSpeed - 14
			script.Parent:WaitForChild("Torso").CFrame = CFrame.new (script.Parent:WaitForChild("Torso").Position) * CFrame.Angles (0, math.rad (90), 0)
			Humanoid.HipHeight = -0.5
			Humanoid:UnequipTools()
			Humanoid.Running:Connect(function(Speed)
				if Speed > 0 then
					DownedMove:AdjustSpeed(1)
				else
					DownedMove:AdjustSpeed(0)
				end
			end)
			local Breathing = Instance.new("Sound", Humanoid.Parent:WaitForChild("Head"))
			Breathing.SoundId = 'rbxassetid://5522914629'
			Breathing.PlaybackSpeed = 1.2
			Breathing.Volume = 6
			Breathing.Looped = true
			Breathing:Play()
			Humanoid.Died:Connect(function()
				if not Dead then
					Dead = true
					Downed = false
					BleedingOut = false
					Humanoid.Parent.PlayerStuff.Values.Downed.Value = false
					print("Died")
					Breathing:Destroy()
					Ragdoll(Humanoid)
					local DeathGui = game.ReplicatedStorage.DeathGui:Clone()
					DeathGui.Parent = script.Parent:WaitForChild("HumanoidRootPart")
					local DownedLight = script.Parent:WaitForChild("HumanoidRootPart"):FindFirstChild("DownedLight")
					if DownedLight then
						DownedLight.Color = Color3.fromRGB(255, 0, 0)
						DownedLight.Range = 7
					else
					end
					while Dead do
						wait()
						for _, v in pairs(Humanoid.Parent:GetDescendants()) do
							if v.Name == "BleedGui" or v.Name == "DownedGui" or v.Name == "Breathing" then
								v:Destroy()
							end
						end
					end
				else
				end
			end)

			Humanoid.Parent.PlayerStuff.Events.Revive.OnServerEvent:Connect(function(P,Button, RootPart, Torso)
				if Button == "hdsgjh43hetsudguaIHBEZUDXDBGHUH3EUJSDXFjHDSUIGFHE3WUFBGZHJDGBUEWH\XF83E84W3857E68456ERT86SEDGUSHGUA" and Humanoid.Parent.PlayerStuff.Values.Downed.Value == true and (RootPart.Position - Torso.Position).Magnitude < 5 then
					DownedMove:Stop()
					DownedIdle:Stop()
					Breathing:Destroy()
					Downed = false
					Humanoid.Parent.PlayerStuff.Values.Downed.Value = false
					Humanoid.Parent.Health.Disabled = false
					Humanoid.Parent.Limp.Disabled = false
					Humanoid.HipHeight = 0
					Humanoid.Health = 25
					local Heal = Instance.new("Sound", Humanoid.Parent:WaitForChild("Head"))
					Heal.SoundId = 'rbxassetid://577886343'
					Heal.PlaybackSpeed = 1
					Heal.Volume = 1
					Heal:Play()
					game.Debris:AddItem(Heal, 5)
					Humanoid.WalkSpeed = 16
					DownedGui:Destroy()
					Humanoid.Parent.PlayerStuff.Events.ShowInv:FireAllClients()
					DownedLight:Destroy() 
					game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,true)
				else
				end
			end)

			repeat
				wait(1)
				Humanoid:TakeDamage(5)
			until not Downed
			DownedMove:Stop()
			DownedIdle:Stop()
		else
		end
	else
	end
end)

script.Parent.PlayerStuff.LimbHealths["Left Leg"].Changed:Connect(function()
	if RLOff and LLOff and not Dead and not Downed and not BleedingOut and not HOff then
		BleedingOut = true
		script.Parent.PlayerStuff.Values.BleedingOut.Value = true
		Downed = true
		CanDown = false
		Ragdoll(Humanoid)
		print(Humanoid.Parent.Name.." Is Bleeding Out")
		Humanoid.Health = Humanoid.MaxHealth
		local BleedGui = game.ReplicatedStorage.BleedGui:Clone()
		BleedGui.Parent = script.Parent:WaitForChild("HumanoidRootPart")
		repeat
			wait(1)
			Humanoid:TakeDamage(5)
		until not BleedingOut
	else 
		return
	end
end)

script.Parent.PlayerStuff.LimbHealths["Right Leg"].Changed:Connect(function()
	if RLOff and LLOff and not Dead and not Downed and not BleedingOut and not HOff then
		BleedingOut = true
		script.Parent.PlayerStuff.Values.BleedingOut.Value = true
		Downed = true
		CanDown = false
		Ragdoll(Humanoid)
		print(Humanoid.Parent.Name.." Is Bleeding Out")
		Humanoid.Health = Humanoid.MaxHealth
		local BleedGui = game.ReplicatedStorage.BleedGui:Clone()
		BleedGui.Parent = script.Parent:WaitForChild("HumanoidRootPart")
		repeat
			wait(1)
			Humanoid:TakeDamage(5)
		until not BleedingOut
	else 
		return
	end
end)

script.Parent.PlayerStuff.LimbHealths["Neck"].Changed:Connect(function()
	if NBroke and not Dead and not BleedingOut and not HOff then
		print("NECKBROKEN")
		BleedingOut = true
		script.Parent.PlayerStuff.Values.BleedingOut.Value = true
		Downed = true
		DownedMove:Stop()
		DownedIdle:Stop()
		Humanoid.Parent.PlayerStuff.Values.Downed.Value = true
		Humanoid.Parent.Health.Disabled = true
		Humanoid.Parent.Limp.Disabled = true
		CanDown = false
		Ragdoll(Humanoid)
		print(Humanoid.Parent.Name.." Is Bleeding Out")
		Humanoid.Health = Humanoid.MaxHealth
		local BleedGui = game.ReplicatedStorage.BleedGui:Clone()
		BleedGui.Parent = script.Parent:WaitForChild("HumanoidRootPart")
		for _, v in pairs(Humanoid.Parent:GetDescendants()) do
			if v.Name == "DownedGui" or v.Name == "Breathing" then
				v:Destroy()
			end
		end
		repeat
			wait(1)
			Humanoid:TakeDamage(5)
		until not BleedingOut
	else 
		return
	end
end)

game:GetService("RunService").Heartbeat:Connect(function()
	for _, v in pairs(script.Parent:GetDescendants()) do
		if v.Name == "Handle" and v:FindFirstChildWhichIsA("SpecialMesh") then
			v.Size = Vector3.new(0.5, 0.5, 0.5)
		end
	end
end)

script.Parent.PlayerStuff.LimbHealths["Left Arm"].Changed:Connect(function()
	if not LAOff then
		local Arm = script.Parent:FindFirstChild("Left Arm")
		if Arm then
			if script.Parent.PlayerStuff.LimbHealths["Left Arm"].Value <= 0 then
				local Joint = script.Parent:WaitForChild("Torso"):FindFirstChild("Left Shoulder")


				if Joint then
					LAOff = true
					Joint:Destroy()

					local Hstub = game.ServerStorage.Stubs.LeftArmStub:Clone()

					Hstub.Parent = script.Parent:WaitForChild("Torso")
					Hstub.PrimaryPart.CFrame = script.Parent:WaitForChild("Torso").CFrame

					local Weld = Instance.new("WeldConstraint", Hstub.PrimaryPart)
					Weld.Part0 = Hstub.PrimaryPart
					Weld.Part1 = script.Parent:WaitForChild("Torso")

					local Part = Instance.new("Part", script.Parent["Right Arm"])
					Part.Size = script.Parent["Left Arm"].Size - Vector3.new(0.25,0.5,0.25)
					Part.Name = "Collider"
					Part.CFrame = script.Parent["Left Arm"].CFrame
					Part.Transparency = 1

					spawn(function()
						for i = 1, 6, 1 do
							wait(1)
							Blood:Create(Hstub.blodlol)
						end
					end)

					local Weld2 = Instance.new("Weld", Part)
					Weld2.Part0 = Part
					Weld2.Part1 = script.Parent["Left Arm"]

					local Velocity = Instance.new("BodyVelocity", script.Parent["Left Arm"])
					Velocity.Velocity = Vector3.new(math.random(-16, 16), math.random(3, 6), math.random(-16, 16))
					game.Debris:AddItem(Velocity, 0.2)

					local Scream = Instance.new("Sound", Humanoid.Parent:WaitForChild("Head"))
					Scream.SoundId = 'rbxassetid://'..Screams[math.random(1, #Screams)]
					game.Debris:AddItem(Scream, 5)
					Scream.PlaybackSpeed = 1.15
					Scream:Play()

					local Gore = Instance.new("Sound", script.Parent["Torso"])
					Gore.SoundId = 'rbxassetid://'..Gores[math.random(1, #Gores)]
					Gore.PlaybackSpeed = 1.5
					game.Debris:AddItem(Gore, 5)
					Gore:Play()

					while wait() do
						if Humanoid.Health <= 0 then
							Scream:Destroy()
							local Armcheck2 = script.Parent:FindFirstChild("Left Arm")
							if Armcheck2 then
								for _, v in pairs(Armcheck2:GetDescendants()) do
									if v:IsA("BallSocketConstraint") then
										v.Attachment0:Destroy()
										v.Attachment1:Destroy()
										v:Destroy()
									end
								end
							else
							end
						end
					end
				else
				end
			end
		else
		end
	else
	end
end)

script.Parent.PlayerStuff.LimbHealths["Right Arm"].Changed:Connect(function()
	if not RAOff then
		local Arm = script.Parent:FindFirstChild("Right Arm")
		if Arm then
			if script.Parent.PlayerStuff.LimbHealths["Right Arm"].Value <= 0 then
				local Joint = script.Parent:WaitForChild("Torso"):FindFirstChild("Right Shoulder")


				if Joint then
					RAOff = true
					Joint:Destroy()

					local Hstub = game.ServerStorage.Stubs.RightArmStub:Clone()

					Hstub.Parent = script.Parent:WaitForChild("Torso")
					Hstub.PrimaryPart.CFrame = script.Parent:WaitForChild("Torso").CFrame

					local Weld = Instance.new("WeldConstraint", Hstub.PrimaryPart)
					Weld.Part0 = Hstub.PrimaryPart
					Weld.Part1 = script.Parent:WaitForChild("Torso")

					local Velocity = Instance.new("BodyVelocity", script.Parent["Right Arm"])
					Velocity.Velocity = Vector3.new(math.random(-16, 16), math.random(3, 6), math.random(-16, 16))
					game.Debris:AddItem(Velocity, 0.2)

					spawn(function()
						for i = 1, 6, 1 do
							wait(1)
							Blood:Create(Hstub.blodlol)
						end
					end)

					local Scream = Instance.new("Sound", Humanoid.Parent:WaitForChild("Head"))
					Scream.SoundId = 'rbxassetid://'..Screams[math.random(1, #Screams)]
					game.Debris:AddItem(Scream, 5)
					Scream.PlaybackSpeed = 1.15
					Scream:Play()

					local Part = Instance.new("Part", script.Parent["Right Arm"])
					Part.Size = script.Parent["Right Arm"].Size - Vector3.new(0.25,0.5,0.25)
					Part.Name = "Collider"
					Part.CFrame = script.Parent["Right Arm"].CFrame
					Part.Transparency = 1



					local Weld2 = Instance.new("Weld", Part)
					Weld2.Part0 = Part
					Weld2.Part1 = script.Parent["Right Arm"]

					local Gore = Instance.new("Sound", script.Parent["Torso"])
					Gore.SoundId = 'rbxassetid://'..Gores[math.random(1, #Gores)]
					Gore.PlaybackSpeed = 1.5
					game.Debris:AddItem(Gore, 5)
					Gore:Play()

					while wait() do
						if Humanoid.Health <= 0 then
							Scream:Destroy()
							local Armcheck2 = script.Parent:FindFirstChild("Right Arm")
							if Armcheck2 then
								for _, v in pairs(Armcheck2:GetDescendants()) do
									if v:IsA("BallSocketConstraint") then
										v.Attachment0:Destroy()
										v.Attachment1:Destroy()
										v:Destroy()
									end
								end
							else
							end
						end
					end
				else
				end
			end
		else
		end
	else
	end
end)

script.Parent.PlayerStuff.LimbHealths["Left Leg"].Changed:Connect(function()
	if not LLOff then
		local Leg = script.Parent:FindFirstChild("Left Leg")
		if Leg then
			if script.Parent.PlayerStuff.LimbHealths["Left Leg"].Value <= 0 then
				local Joint = script.Parent:WaitForChild("Torso"):FindFirstChild("Left Hip")


				if Joint then
					LLOff = true
					Joint:Destroy()

					local Hstub = game.ServerStorage.Stubs.LeftLegStub:Clone()

					Hstub.Parent = script.Parent:WaitForChild("Torso")
					Hstub.PrimaryPart.CFrame = script.Parent:WaitForChild("Torso").CFrame

					local Weld = Instance.new("WeldConstraint", Hstub.PrimaryPart)
					Weld.Part0 = Hstub.PrimaryPart
					Weld.Part1 = script.Parent:WaitForChild("Torso")


					local Part = Instance.new("Part", script.Parent["Right Arm"])
					Part.Size = script.Parent["Left Leg"].Size - Vector3.new(0.25,0.5,0.25)
					Part.Name = "Collider"
					Part.CFrame = script.Parent["Left Leg"].CFrame
					Part.Transparency = 1

					spawn(function()
						for i = 1, 6, 1 do
							wait(1)
							Blood:Create(Hstub.blodlol)
						end
					end)



					local Weld2 = Instance.new("Weld", Part)
					Weld2.Part0 = Part
					Weld2.Part1 = script.Parent["Left Leg"]


					local Velocity = Instance.new("BodyVelocity", script.Parent["Left Leg"])
					Velocity.Velocity = Vector3.new(math.random(-16, 16), math.random(3, 6), math.random(-16, 16))
					game.Debris:AddItem(Velocity, 0.2)

					local Scream = Instance.new("Sound", Humanoid.Parent:WaitForChild("Head"))
					Scream.SoundId = 'rbxassetid://'..Screams[math.random(1, #Screams)]
					game.Debris:AddItem(Scream, 5)
					Scream.PlaybackSpeed = 1.15
					Scream:Play()

					local Gore = Instance.new("Sound", script.Parent["Torso"])
					Gore.SoundId = 'rbxassetid://'..Gores[math.random(1, #Gores)]
					Gore.PlaybackSpeed = 1.5
					game.Debris:AddItem(Gore, 5)
					Gore:Play()

					while wait() do
						if Humanoid.Health <= 0 then
							Scream:Destroy()
							local Legcheck2 = script.Parent:FindFirstChild("Left Leg")
							if Legcheck2 then
								for _, v in pairs(Legcheck2:GetDescendants()) do
									if v:IsA("BallSocketConstraint") then
										v.Attachment0:Destroy()
										v.Attachment1:Destroy()
										v:Destroy()
									end
								end
							else
							end
						end
					end
				else
				end
			end
		else
		end
	else
	end
end)

script.Parent.PlayerStuff.LimbHealths["Right Leg"].Changed:Connect(function()
	if not RLOff then
		local Leg = script.Parent:FindFirstChild("Right Leg")
		if Leg then
			if script.Parent.PlayerStuff.LimbHealths["Right Leg"].Value <= 0 then
				local Joint = script.Parent:WaitForChild("Torso"):FindFirstChild("Right Hip")


				if Joint then
					RLOff = true
					Joint:Destroy()


					local Hstub = game.ServerStorage.Stubs.RightLegStub:Clone()

					Hstub.Parent = script.Parent:WaitForChild("Torso")
					Hstub.PrimaryPart.CFrame = script.Parent:WaitForChild("Torso").CFrame

					local Weld = Instance.new("WeldConstraint", Hstub.PrimaryPart)
					Weld.Part0 = Hstub.PrimaryPart
					Weld.Part1 = script.Parent:WaitForChild("Torso")

					local Part = Instance.new("Part", script.Parent["Right Arm"])
					Part.Size = script.Parent["Right Leg"].Size - Vector3.new(0.25,0.5,0.25)
					Part.Name = "Collider"
					Part.CFrame = script.Parent["Right Leg"].CFrame
					Part.Transparency = 1



					local Weld2 = Instance.new("Weld", Part)
					Weld2.Part0 = Part
					Weld2.Part1 = script.Parent["Right Leg"]

					spawn(function()
						for i = 1, 6, 1 do
							wait(1)
							Blood:Create(Hstub.blodlol)
						end
					end)

					local Velocity = Instance.new("BodyVelocity", script.Parent["Right Leg"])
					Velocity.Velocity = Vector3.new(math.random(-16, 16), math.random(3, 6), math.random(-16, 16))
					game.Debris:AddItem(Velocity, 0.2)

					local Scream = Instance.new("Sound", Humanoid.Parent:WaitForChild("Head"))
					Scream.SoundId = 'rbxassetid://'..Screams[math.random(1, #Screams)]
					game.Debris:AddItem(Scream, 5)
					Scream.PlaybackSpeed = 1.15
					Scream:Play()

					local Gore = Instance.new("Sound", script.Parent["Torso"])
					Gore.SoundId = 'rbxassetid://'..Gores[math.random(1, #Gores)]
					Gore.PlaybackSpeed = 1.5
					game.Debris:AddItem(Gore, 5)
					Gore:Play()

					while wait() do
						if Humanoid.Health <= 0 then
							Scream:Destroy()
							local Legcheck2 = script.Parent:FindFirstChild("Right Leg")
							if Legcheck2 then
								for _, v in pairs(Legcheck2:GetDescendants()) do
									if v:IsA("BallSocketConstraint") then
										v.Attachment0:Destroy()
										v.Attachment1:Destroy()
										v:Destroy()
									end
								end
							else
							end
						end
					end
				else
				end
			end
		else
		end
	else
	end
end)

script.Parent.PlayerStuff.LimbHealths["Head"].Changed:Connect(function()
	if not HOff then
		local Head = script.Parent:FindFirstChild("Head")
		if Head then
			if script.Parent.PlayerStuff.LimbHealths["Head"].Value <= 0 then
				local Joint = script.Parent:WaitForChild("Torso"):FindFirstChild("Neck")

				repeat		
					wait()
					Humanoid:TakeDamage(math.huge)
				until Humanoid.Health <= 0

				if Joint then
					HOff = true
					Joint:Destroy()

					Hstub2.Parent = script.Parent:WaitForChild("Head")
					Hstub2.PrimaryPart.CFrame = script.Parent:WaitForChild("Head").CFrame

					local weldd = Instance.new("WeldConstraint", Hstub2.PrimaryPart)
					weldd.Part0=Hstub2.PrimaryPart
					weldd.Part1=script.Parent:WaitForChild("Head")

					local Hstub = game.ServerStorage.Stubs.NeckStub:Clone()

					Hstub.Parent = script.Parent:WaitForChild("Torso")
					Hstub.PrimaryPart.CFrame = script.Parent:WaitForChild("Torso").CFrame

					local Weld = Instance.new("WeldConstraint", Hstub.PrimaryPart)
					Weld.Part0 = Hstub.PrimaryPart
					Weld.Part1 = script.Parent:WaitForChild("Torso")

					local Part = Instance.new("Part", script.Parent["Head"])
					Part.Size = script.Parent["Head"].Size - Vector3.new(0.25,0.5,0.25)
					Part.Name = "Collider"
					Part.CFrame = script.Parent["Head"].CFrame
					Part.Transparency = 1

					spawn(function()
						for i = 1, 6, 1 do
							wait(1)
							Blood:Create(Hstub.blodlol)
						end
					end)



					local Weld2 = Instance.new("Weld", Part)
					Weld2.Part0 = Part
					Weld2.Part1 = script.Parent["Head"]

					local Velocity = Instance.new("BodyVelocity", script.Parent["Head"])
					Velocity.Velocity = Vector3.new(math.random(-16, 16), math.random(3, 6), math.random(-16, 16))
					game.Debris:AddItem(Velocity, 0.2)

					local Scream = Instance.new("Sound", Humanoid.Parent:WaitForChild("Head"))
					Scream.SoundId = 'rbxassetid://'..Screams[math.random(1, #Screams)]
					game.Debris:AddItem(Scream, 5)
					Scream:Play()
					Scream.PlaybackSpeed = 1.15

					local Gore = Instance.new("Sound", script.Parent["Torso"])
					Gore.SoundId = 'rbxassetid://'..Gores[math.random(1, #Gores)]
					Gore.PlaybackSpeed = 1.5
					game.Debris:AddItem(Gore, 5)
					Gore:Play()

					wait(0.17)

					while wait() do
						if Humanoid.Health <= 0 then
							Scream:Destroy()
							local Headcheck2 = script.Parent:FindFirstChild("Head")
							if Headcheck2 then
								for _, v in pairs(Headcheck2:GetDescendants()) do
									if v:IsA("BallSocketConstraint") then
										v.Attachment0:Destroy()
										v.Attachment1:Destroy()
										v:Destroy()
									end
								end
							else
							end
						end
					end
				else
				end
			end
		else
		end
	else
	end
end)

script.Parent.PlayerStuff.LimbHealths["Head2"].Changed:Connect(function()
	if not HOff then
		local Head = script.Parent:FindFirstChild("Head")
		if Head then
			if script.Parent.PlayerStuff.LimbHealths["Head2"].Value <= 0 then

				repeat		
					wait()
					Humanoid:TakeDamage(math.huge)
				until Humanoid.Health <= 0

				Head.Transparency = 1
				if script.Parent:FindFirstChild("Helm") then
					script.Parent.Helm:Destroy()
				end

				Humanoid:RemoveAccessories()

				for _, v in pairs(Head:GetChildren()) do
					if v.Name == "Face" or v.Name == "face" then
						v:Destroy()
					end
				end

				if script.Parent:FindFirstChild("Helmet") then
					script.Parent.Helmet:Destroy()
				end

				HOff = true

				local Hstub = game.ServerStorage.Stubs.NeckStub:Clone()

				Hstub.Parent = script.Parent:WaitForChild("Torso")
				Hstub.PrimaryPart.CFrame = script.Parent:WaitForChild("Torso").CFrame

				local Weld = Instance.new("WeldConstraint", Hstub.PrimaryPart)
				Weld.Part0 = Hstub.PrimaryPart
				Weld.Part1 = script.Parent:WaitForChild("Torso")

				spawn(function()
					for i = 1, 6, 1 do
						wait(1)
						Blood:Create(Hstub.blodlol)
					end
				end)

				local Gore = Instance.new("Sound", Head)
				Gore.SoundId = 'rbxassetid://429400881'
				Gore.PlaybackSpeed = 1.5
				game.Debris:AddItem(Gore, 5)
				Gore:Play()
			end
		else
		end
	else
	end
end)

script.Parent.PlayerStuff.LimbHealths["Neck"].Changed:Connect(function()
	if not NBroke then
		local Head = script.Parent:FindFirstChild("Head")
		if Head then
			if script.Parent.PlayerStuff.LimbHealths["Neck"].Value <= 0 then
				local Joint = script.Parent:WaitForChild("Torso"):FindFirstChild("Neck")

				if Joint then
					Joint.Enabled = false

					Head.Orientation = Head.Orientation + Vector3.new(90,0,0)

					local Weld = Instance.new("WeldConstraint", Head)
					Weld.Part0 = Head
					Weld.Part1 = script.Parent:WaitForChild("Torso")

					NBroke = true

					local Hstub = game.ServerStorage.Stubs.NeckStub:Clone()

					Hstub.Parent = script.Parent:WaitForChild("Torso")
					Hstub.PrimaryPart.CFrame = script.Parent:WaitForChild("Torso").CFrame

					local Weld = Instance.new("WeldConstraint", Hstub.PrimaryPart)
					Weld.Part0 = Hstub.PrimaryPart
					Weld.Part1 = script.Parent:WaitForChild("Torso")

					spawn(function()
						for i = 1, 6, 1 do
							wait(1)
							Blood:Create(Hstub.blodlol)
						end
					end)

					local Gore = Instance.new("Sound", Head)
					Gore.SoundId = 'rbxassetid://429400881'
					Gore.PlaybackSpeed = 1.5
					game.Debris:AddItem(Gore, 5)
					Gore:Play()

					if not Dead then
						local Scream = Instance.new("Sound", Humanoid.Parent:WaitForChild("Head"))
						Scream.SoundId = 'rbxassetid://'..Screams[math.random(1, #Screams)]
						game.Debris:AddItem(Scream, 5)
						Scream.PlaybackSpeed = 1.15
						Scream:Play()	
						while Scream do
							wait()
							if Humanoid.Health <= 0 then
								Scream:Destroy()
							end
						end
					end
				end
			end
		else
		end
	else
	end
end)
--[[

game:GetService("RunService").Heartbeat:Connect(function()
	local HumanoidRootPart = script.Parent.PrimaryPart
	if HumanoidRootPart then
		if HumanoidRootPart.Velocity.x < -175 or HumanoidRootPart.Velocity.y < -175 or HumanoidRootPart.Velocity.z < -175 and not HumanoidRootPart:FindFirstChild("ADONIS_FLIGHT") then
			if not Falling then
				Falling = true
				Ragdoll(Humanoid)
				local Scream = Instance.new("Sound", Humanoid.Parent:WaitForChild("Head"))
				Scream.SoundId = 'rbxassetid://'..Screams[math.random(1, #Screams)]
				game.Debris:AddItem(Scream, 5)
				Scream.PlaybackSpeed = 1.15
				Scream:Play()	

				DownedIdle:Stop()
				DownedMove:Stop()
				for _, v in pairs(Humanoid.Parent:GetChildren()) do
					if v:IsA("BasePart") then
						local Con
						Con = v.Touched:Connect(function(hit)
							if not hit:IsDescendantOf(script.Parent) then
								Falling = false
								Humanoid:TakeDamage(1000)
								spawn(function()
									for i = 1, 6, 1 do
										wait()
										Blood:Create(HumanoidRootPart)
									end
								end)
								for _, v in pairs(script.Parent.PlayerStuff.LimbHealths:GetChildren()) do
									v.Value = v.MinValue
								end
								Con:Disconnect()
							else
							end
						end)
					end
				end

			end
		else
		end
	else
	end
end)

]]--

script.Parent.PlayerStuff.Events.Cough.Event:Connect(function(Tier)
	if Tier == "CS" then
		repeat 
			wait(0.3)
			Coughed = Coughed + 1
			Humanoid:TakeDamage(math.random(2,4))
		until Coughed == 15
		Coughed = 0
	elseif Tier == "Mustard" then
		repeat 
			wait(0.3)
			Coughed = Coughed + 1
			Humanoid:TakeDamage(math.random(4,8))
		until Coughed == 15
		Coughed = 0
	end
end)

while BleedingOut do
	Humanoid.PlatformStand = true
	wait(0.1)
end

You have to dig through the code to find it, my apologies.

local head = script.Parent.Head
local leftarm = script.Parent["Left Arm"]
local leftleg = script.Parent["Left Leg"]
local rightleg = script.Parent["Right Leg"]
local rightarm = script.Parent["Right Arm"]
local torso = script.Parent.Torso
local player = game.Players:GetPlayerFromCharacter(script.Parent)
colliderll = Instance.new("Part", leftleg)
colliderll.Position = Vector3.new(0,999,0)
colliderll.Size = Vector3.new(1.5, 1, 1)
colliderll.Shape = "Block" --collision
local weld = Instance.new("Weld", colliderll)
weld.Part0 = leftleg
weld.Part1 = colliderll
weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
colliderll.TopSurface = "Smooth"
colliderll.BottomSurface = "Smooth"
colliderll.formFactor = "Symmetric"
colliderll.Transparency=1
local nocol = Instance.new("NoCollisionConstraint", colliderll)
nocol.Part0=colliderll
nocol.Part1=leftleg
nocol.Enabled=true
colliderll.CanCollide = false
--local nocolT = Instance.new("NoCollisionConstraint", torso)
--nocolT.Part0=torso
--nocolT.Part1=collider
--nocolT.Enabled=true

colliderrl = Instance.new("Part", rightleg)
colliderrl.Position = Vector3.new(0,999,0)
colliderrl.Size = Vector3.new(1.5, 1, 1)
colliderrl.Shape = "Block" --collision
local weld = Instance.new("Weld", colliderrl)
weld.Part0 = rightleg
weld.Part1 = colliderrl
weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
colliderrl.TopSurface = "Smooth"
colliderrl.BottomSurface = "Smooth"
colliderrl.formFactor = "Symmetric"
colliderrl.Transparency=1
local nocol = Instance.new("NoCollisionConstraint", colliderrl)
nocol.Part0=colliderrl
nocol.Part1=rightleg
nocol.Enabled=true
colliderrl.CanCollide = false
--local nocolT = Instance.new("NoCollisionConstraint", torso)
--nocolT.Part0=torso
--nocolT.Part1=collider
--nocolT.Enabled=true

colliderra = Instance.new("Part", rightarm)
colliderra.Position = Vector3.new(0,999,0)
colliderra.Size = Vector3.new(1.5, 1, 1)
colliderra.Shape = "Block" --collision
local weld = Instance.new("Weld", colliderra)
weld.Part0 = rightarm
weld.Part1 = colliderra
weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
colliderra.TopSurface = "Smooth"
colliderra.BottomSurface = "Smooth"
colliderra.formFactor = "Symmetric"
colliderra.Transparency=1
local nocol = Instance.new("NoCollisionConstraint", colliderra)
nocol.Part0=colliderra
nocol.Part1=rightarm
nocol.Enabled=true
colliderra.CanCollide = false
--local nocolT = Instance.new("NoCollisionConstraint", torso)
--nocolT.Part0=torso
--nocolT.Part1=collider
--nocolT.Enabled=true

colliderla = Instance.new("Part", leftarm)
colliderla.Position = Vector3.new(0,999,0)
colliderla.Size = Vector3.new(1.5, 1, 1)
colliderla.Shape = "Block" --collision
local weld = Instance.new("Weld", colliderla)
weld.Part0 = leftarm
weld.Part1 = colliderla
weld.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2)
colliderla.TopSurface = "Smooth"
colliderla.BottomSurface = "Smooth"
colliderla.formFactor = "Symmetric"
colliderla.Transparency=1
local nocol = Instance.new("NoCollisionConstraint", colliderla)
nocol.Part0=colliderla
nocol.Part1=leftarm
nocol.Enabled=true
colliderla.CanCollide = false
--local nocolT = Instance.new("NoCollisionConstraint", torso)
--nocolT.Part0=torso
--nocolT.Part1=collider
--nocolT.Enabled=true

local HeadA = Instance.new("Attachment")
HeadA.Name = "HeadA"
HeadA.Parent = head
HeadA.Position = Vector3.new(0, -0.5, 0)
HeadA.Axis = Vector3.new(1, 0, 0)
HeadA.SecondaryAxis = Vector3.new(0, 1, 0)

local LeftArmA = Instance.new("Attachment")
LeftArmA.Name = "LeftArmA"
LeftArmA.Parent = leftarm
LeftArmA.Position = Vector3.new(0, 0.6, 0)
LeftArmA.Axis = Vector3.new(1, 0, 0)
LeftArmA.SecondaryAxis = Vector3.new(0, 1, 0)

local LeftLegA = Instance.new("Attachment")
LeftLegA.Name = "LeftLegA"
LeftLegA.Parent = leftleg
LeftLegA.Position = Vector3.new(0, 1, 0)
LeftLegA.Axis = Vector3.new(1, 0, 0)
LeftLegA.SecondaryAxis = Vector3.new(1, 0, 0)

local RightArmA = Instance.new("Attachment")
RightArmA.Name = "RightArmA"
RightArmA.Parent = rightarm
RightArmA.Position = Vector3.new(0, 0.6, 0)
RightArmA.Axis = Vector3.new(1, 0, 0)
RightArmA.SecondaryAxis = Vector3.new(0, 1, 0)

local RightLegA = Instance.new("Attachment")
RightLegA.Name = "RightLegA"
RightLegA.Parent = rightleg
RightLegA.Position = Vector3.new(0, 1, 0)
RightLegA.Axis = Vector3.new(1, 0, 0)
RightLegA.SecondaryAxis = Vector3.new(0, 1, 0)

local TorsoA = Instance.new("Attachment")
TorsoA.Name = "TorsoA"
TorsoA.Parent = torso
TorsoA.Position = Vector3.new(0, 1, 0)
TorsoA.Axis = Vector3.new(1, 0, 0)
TorsoA.SecondaryAxis = Vector3.new(0, 1, 0)

local TorsoA1 = Instance.new("Attachment")
TorsoA1.Name = "TorsoA1"
TorsoA1.Parent = torso
TorsoA1.Position = Vector3.new(-0.5, -1, 0)
TorsoA1.Axis = Vector3.new(1, 0, 0)
TorsoA1.SecondaryAxis = Vector3.new(0, 1, 0)

local TorsoA2 = Instance.new("Attachment")
TorsoA2.Name = "TorsoA2"
TorsoA2.Parent = torso
TorsoA2.Position = Vector3.new(-1.5, 0.5, 0)
TorsoA2.Axis = Vector3.new(1, 0, 0)
TorsoA2.SecondaryAxis = Vector3.new(0, 1, 0)

local TorsoA3 = Instance.new("Attachment")
TorsoA3.Name = "TorsoA3"
TorsoA3.Parent = torso
TorsoA3.Position = Vector3.new(1.5, 0.5, 0)
TorsoA3.Axis = Vector3.new(1, 0, 0)
TorsoA3.SecondaryAxis = Vector3.new(0, 1, 0)

local TorsoA4 = Instance.new("Attachment")
TorsoA4.Name = "TorsoA4"
TorsoA4.Parent = torso
TorsoA4.Position = Vector3.new(0, 1, 0)
TorsoA4.Axis = Vector3.new(1, 0, 0)
TorsoA4.SecondaryAxis = Vector3.new(0, 1, 0)

local TorsoA5 = Instance.new("Attachment")
TorsoA5.Name = "TorsoA5"
TorsoA5.Parent = torso
TorsoA5.Position = Vector3.new(0.5, -1, 0)
TorsoA5.Axis = Vector3.new(1, 0, 0)
TorsoA5.SecondaryAxis = Vector3.new(0, 1, 0)

	local HA = Instance.new("BallSocketConstraint")
	HA.Parent = head
	HA.Attachment0 = HeadA
	HA.Attachment1 = TorsoA4
	HA.Enabled = true
	HA.LimitsEnabled = true
	HA.TwistLimitsEnabled = true
	HA.Restitution = 0
	HA.UpperAngle = 2
	HA.TwistLowerAngle = 0
	HA.TwistUpperAngle = 0
	HA.Name = "neck"
	
	local LAT = Instance.new("BallSocketConstraint")
	LAT.Parent = leftarm
	LAT.Attachment0 = LeftArmA
	LAT.Attachment1 = TorsoA2
	LAT.Enabled = true
	LAT.LimitsEnabled = true
	LAT.TwistLimitsEnabled = false
	LAT.Restitution = 0
	LAT.UpperAngle = 90
	LAT.Name = "shoulder"
	
	
	local RAT = Instance.new("BallSocketConstraint")
	RAT.Parent = rightarm
	RAT.Attachment0 = RightArmA
	RAT.Attachment1 = TorsoA3
	RAT.Enabled = true
	RAT.LimitsEnabled = true
	RAT.TwistLimitsEnabled = false
	RAT.Restitution = 0
	RAT.UpperAngle = 90
	RAT.Name = "shoulder"
	
	local TLL = Instance.new("BallSocketConstraint")
	TLL.Parent = torso
	TLL.Attachment0 = TorsoA1
	TLL.Attachment1 = LeftLegA
	TLL.Enabled = true
	TLL.LimitsEnabled = true
	TLL.TwistLimitsEnabled = false
	TLL.Restitution = 0
	TLL.UpperAngle = 90
	TLL.Name = "lhip"
	
	local TRL = Instance.new("BallSocketConstraint")
	TRL.Parent = torso
	TRL.Attachment0 = TorsoA5
	TRL.Attachment1 = RightLegA
	TRL.Enabled = true
	TRL.LimitsEnabled = true
	TRL.TwistLimitsEnabled = false
	TRL.Restitution = 0
	TRL.UpperAngle = 90
	TRL.Name = "rhip"

-- Scripted by Corktail
script.Parent.Humanoid.BreakJointsOnDeath = true
name="Humanoid"
--
--if true then
--	if false then
--	end
--end

local stunmeter = Instance.new("NumberValue",script.Parent.Humanoid)
stunmeter.Name = "SHealth"
stunmeter.Value=100


while wait() do
	
	if stunmeter.Value<25 or script.Parent.Humanoid.Health<=0.5 then
--		script.Parent.Humanoid:ChangeState("Freefall")		
		 wait(0.0001)
		if script.Parent:findFirstChild("Torso"):findFirstChild("Neck").Part0 ~= nil then
script.Parent:findFirstChild("Torso"):findFirstChild("Left Shoulder").Part0 = nil
script.Parent:findFirstChild("Torso"):findFirstChild("Right Shoulder").Part0 = nil
script.Parent:findFirstChild("Torso"):findFirstChild("Left Hip").Part0 = nil
script.Parent:findFirstChild("Torso"):findFirstChild("Right Hip").Part0 = nil
script.Parent:findFirstChild("Torso"):findFirstChild("Neck").Part0 = nil
colliderla.CanCollide=true
colliderra.CanCollide=true
colliderll.CanCollide=true
colliderrl.CanCollide=true
script.Parent.Humanoid.PlatformStand = true
script.Parent.Humanoid.Jump = false
end
if stunmeter.Value<25 then
	stunmeter.Value = stunmeter.Value + 1
		if player.TeamColor == BrickColor.new("Forest green") then
		stunmeter.Value = stunmeter.Value + 1
	end
	wait(0.5)
	if stunmeter.Value<0 then
		stunmeter.Value=1
	end
end
	else
script.Parent:findFirstChild("Torso"):findFirstChild("Left Shoulder").Part0 = script.Parent:findFirstChild("Torso")
script.Parent:findFirstChild("Torso"):findFirstChild("Right Shoulder").Part0 = script.Parent:findFirstChild("Torso")
script.Parent:findFirstChild("Torso"):findFirstChild("Left Hip").Part0 = script.Parent:findFirstChild("Torso")
script.Parent:findFirstChild("Torso"):findFirstChild("Right Hip").Part0 = script.Parent:findFirstChild("Torso")
script.Parent:findFirstChild("Torso"):findFirstChild("Neck").Part0 = script.Parent:findFirstChild("Torso")
colliderla.CanCollide=false
colliderra.CanCollide=false
colliderll.CanCollide=false
colliderrl.CanCollide=false
script.Parent.Humanoid.PlatformStand = false
if stunmeter.Value>=25 then
	stunmeter.Value = stunmeter.Value + 0.35
	if player.TeamColor == BrickColor.new("Forest green") then
		stunmeter.Value = stunmeter.Value + 0.75
	end
	wait(0.5)
	if stunmeter.Value>100 then
		stunmeter.Value=100
	end
end
--script.Parent.Humanoid:ChangeState("GettingUp")	

--script.Parent:findFirstChild("Head"):findFirstChild("face").Texture = "http://www	
end

end

It seems like in this script all the way down when it says “while wait() do” is making you crash. Maybe try putting wait(1) instead of wait().
`

Thanks, It definitely fixes the crashing problem. That was a really big problem. Phew! Also, if you don’t mind. Can you tell me why “while wait() do” crashes the application? Thanks.

1 Like

Your waiting less than a second repeating the process over and over again. Unless you have an extremely good gaming pc. I doubt that anything like that can run every 0.1 seconds. Trust me, I make the same mistake aswell.

Ok, got it. I’ll try to remember. :+1:

More better and efficient, use events inetad (Humanoid:GetPropertyChangedSignal(“Health”) can help here)

1 Like