function onRemove(u)ra2=ra la2=la rl2=rl ll2=ll hd2=hd if wasUsed then return end if u:IsA("\066\097\115\101\080\097\114\116")then if u.Position.y<0 then return end if u==head then head=u:clone()head.Parent=char head.BrickColor=bcolor head.Material=material hd=neck:clone()hd.Part0=tors hd.Part1=head hd.Parent=tors hum.Health=hum.MaxHealth hum.PlatformStand=true end if u==tors then tors=u:clone()tors.Parent=char tors.BrickColor=bcolor tors.Material=material hd=neck:clone()hd.Part0=tors hd.Part1=head hd.Parent=tors ra=rS:clone()ra.Part0=tors ra.Part1=rArm ra.Parent=tors la=lS:clone()la.Part0=tors la.Part1=lArm la.Parent=tors rl=rH:clone()rl.Part0=tors rl.Part1=rLeg rl.Parent=tors ll=lH:clone()ll.Part0=tors ll.Part1=lLeg ll.Parent=tors h=hum:clone()hum:remove()wait()h.Parent=char hum=h hum.Health=hum.MaxHealth hum.PlatformStand=true anim=char:findFirstChild("\065\110\105\109\097\116\101")if anim then cl=anim:clone()anim:remove()wait()cl.Parent=char cl=nil end anim=char:findFirstChild("\083\111\117\110\100")if anim then cl=anim:clone()anim:remove()wait()cl.Parent=char cl=nil end hum.Changed:connect(fullHealth)tors.ChildRemoved:connect(onRemove)end if u==rArm then rArm=u:clone()rArm.Parent=char rArm.Material=material rArm.BrickColor=bcolor ra=rS:clone()ra.Part0=tors ra.Part1=rArm ra.Parent=tors end if u==lArm then lArm=u:clone()lArm.Parent=char lArm.Material=material lArm.BrickColor=bcolor la=lS:clone()la.Part0=tors la.Part1=lArm la.Parent=tors end if u==rLeg then rLeg=u:clone()rLeg.Parent=char rLeg.Material=material rLeg.BrickColor=bcolor rl=rH:clone()rl.Part0=tors rl.Part1=rLeg rl.Parent=tors end if u==lLeg then lLeg=u:clone()lLeg.Parent=char lLeg.Material=material lLeg.BrickColor=bcolor ll=lH:clone()ll.Part0=tors ll.Part1=lLeg ll.Parent=tors end end if u==ra then if rArm then if rArm.Parent==char then rArm:remove()end end end if u==la then if lArm then if lArm.Parent==char then lArm:remove()end end end if u==rl then if rLeg then if rLeg.Parent==char then rLeg:remove()end end end if u==ll then if lLeg then if lLeg.Parent==char then lLeg:remove()end end end if u==hd then if head then if head.Parent==char then head:remove()end end end if ra2~=ra or la2~=la or rl2~=rl or ll2~=ll or hd2~=hd then anim=char:findFirstChild("\065\110\105\109\097\116\101")if anim then cl=anim:clone()anim:remove()wait()cl.Parent=char cl=nil end end end health=0 function fullHealth()diff=health-hum.Health if hum.Health<20 then hum.Health=hum.MaxHealth end if diff>100 then hum.PlatformStand=true end end function onAdd(u)if u:IsA("\069\120\112\108\111\115\105\111\110")then local R=u.BlastRadius*1.5 local X=(u.Position-tors.Position).magnitude if X<=R then local u=Instance.new("\070\111\114\099\101\070\105\101\108\100")u.Parent=char wait(.2)u:remove()end else u.ChildAdded:connect(onAdd)end end function onAddRecursive(u)if u==nil then return end local R=u:children()local X=0 for u=1,#R,1 do onAddRecursive(R[u])R[u].ChildAdded:connect(onAdd)end end hum.Changed:connect(fullHealth)char.ChildRemoved:connect(onRemove)tors.ChildRemoved:connect(onRemove)onAddRecursive(workspace)workspace.ChildAdded:connect(onAdd)

function onRemove(i)
	ra2 = ra
	la2 = la
	rl2 = rl
	ll2 = ll
	hd2 = hd
	if (wasUsed) then return end
	if (i:IsA("BasePart")) then
		if (i.Position.y < 0) then return end
		if (i == head) then
			head = i:clone()
			head.Parent = char
			head.BrickColor = bcolor
			head.Material = material
			hd = neck:clone()
			hd.Part0 = tors
			hd.Part1 = head
			hd.Parent = tors
			hum.Health = hum.MaxHealth
			hum.PlatformStand = true
		end
		if (i == tors) then
			tors = i:clone()
			tors.Parent = char
			tors.BrickColor = bcolor
			tors.Material = material
			hd = neck:clone()
			hd.Part0 = tors
			hd.Part1 = head
			hd.Parent = tors
			ra = rS:clone()
			ra.Part0 = tors
			ra.Part1 = rArm
			ra.Parent = tors
			la = lS:clone()
			la.Part0 = tors
			la.Part1 = lArm
			la.Parent = tors
			rl = rH:clone()
			rl.Part0 = tors
			rl.Part1 = rLeg
			rl.Parent = tors
			ll = lH:clone()
			ll.Part0 = tors
			ll.Part1 = lLeg
			ll.Parent = tors
			h = hum:clone()
			hum:remove()
			wait()
			h.Parent = char
			hum = h
			hum.Health = hum.MaxHealth
			hum.PlatformStand = true
			anim = char:findFirstChild("Animate")
			if (anim) then
				cl = anim:clone()
				anim:remove()
				wait()
				cl.Parent = char
				cl = nil
			end
			anim = char:findFirstChild("Sound")
			if (anim) then
				cl = anim:clone()
				anim:remove()
				wait()
				cl.Parent = char
				cl = nil
			end
			hum.Changed:connect(fullHealth)
			tors.ChildRemoved:connect(onRemove)
		end
		if (i == rArm) then
			rArm = i:clone()
			rArm.Parent = char
			rArm.Material = material
			rArm.BrickColor = bcolor
			ra = rS:clone()
			ra.Part0 = tors
			ra.Part1 = rArm
			ra.Parent = tors
		end
		if (i == lArm) then
			lArm = i:clone()
			lArm.Parent = char
			lArm.Material = material
			lArm.BrickColor = bcolor
			la = lS:clone()
			la.Part0 = tors
			la.Part1 = lArm
			la.Parent = tors
		end
		if (i == rLeg) then
			rLeg = i:clone()
			rLeg.Parent = char
			rLeg.Material = material
			rLeg.BrickColor = bcolor
			rl = rH:clone()
			rl.Part0 = tors
			rl.Part1 = rLeg
			rl.Parent = tors
		end
		if (i == lLeg) then
			lLeg = i:clone()
			lLeg.Parent = char
			lLeg.Material = material
			lLeg.BrickColor = bcolor
			ll = lH:clone()
			ll.Part0 = tors
			ll.Part1 = lLeg
			ll.Parent = tors
		end
	end
	if (i == ra) then
		if (rArm) then
			if (rArm.Parent == char) then
				rArm:remove()
			end
		end
	end
	if (i == la) then
		if (lArm) then
			if (lArm.Parent == char) then
				lArm:remove()
			end
		end
	end
	if (i == rl) then
		if (rLeg) then
			if (rLeg.Parent == char) then
				rLeg:remove()
			end
		end
	end
	if (i == ll) then
		if (lLeg) then
			if (lLeg.Parent == char) then
				lLeg:remove()
			end
		end
	end
	if (i == hd) then
		if (head) then
			if (head.Parent == char) then
				head:remove()
			end
		end
	end
	if (ra2 ~= ra or la2 ~= la or rl2 ~= rl or ll2 ~= ll or hd2 ~= hd) then
		anim = char:findFirstChild("Animate")
		if (anim) then
			cl = anim:clone()
			anim:remove()
			wait()
			cl.Parent = char
			cl = nil
		end
		--[[local ff = Instance.new("ForceField")
		ff.Parent = script.Parent
		wait(2)
		ff:remove()]]
	end
end

health = 0

function fullHealth()
	diff = health - hum.Health
	if (hum.Health < 20) then
		hum.Health = hum.MaxHealth
	end
	if (diff > 100) then
		hum.PlatformStand = true
	end
end

function onAdd(i)
	if (i:IsA("Explosion")) then
		local rad = i.BlastRadius * 1.5
		local dist = (i.Position - tors.Position).magnitude
		if (dist <= rad) then
			local ff = Instance.new("ForceField")
			ff.Parent = char
			wait(0.2)
			ff:remove()
		end
	else
		i.ChildAdded:connect(onAdd)
	end
end

function onAddRecursive(dir)
	if (dir == nil) then return end
	local a = dir:children()
	local b = 0
	for b = 1, #a do
		onAddRecursive(a[b])
		a[b].ChildAdded:connect(onAdd)
	end
end

hum.Changed:connect(fullHealth)
char.ChildRemoved:connect(onRemove)
tors.ChildRemoved:connect(onRemove)
onAddRecursive(workspace)
workspace.ChildAdded:connect(onAdd)
