--[===[ DO NOT edit ANYTHING below! ]===]


local isOn = false

script.Parent.ClickDetector.MouseClick:connect(function(Player)
	local Character = Player.Character
	
	Character.Animate.Disabled = true
	
	wait()
	
	local root = Character.HumanoidRootPart:findFirstChild("RootJoint") and Character.HumanoidRootPart.RootJoint:Clone()
	local neck = Character.Torso:findFirstChild("Neck") and Character.Torso.Neck:Clone()
	local lshoulder = Character.Torso:findFirstChild("Left Shoulder") and Character.Torso["Left Shoulder"]:Clone()
	local rshoulder = Character.Torso:findFirstChild("Right Shoulder") and Character.Torso["Right Shoulder"]:Clone()
	local lhip = Character.Torso:findFirstChild("Left Hip") and Character.Torso["Left Hip"]:Clone()
	local rhip = Character.Torso:findFirstChild("Right Hip") and Character.Torso["Right Hip"]:Clone()
	
	Character.Torso.Size = Character.Torso.Size * size
	Character.HumanoidRootPart.Size = Character.HumanoidRootPart.Size * size
	Character.Head.Size = Character.Head.Size * size
	
	root.Parent = Character.HumanoidRootPart
	root.Part0 = Character.HumanoidRootPart
	root.Part1 = Character.Torso
	root:SetDesiredAngle(0)
	
	neck.Parent = Character.Torso
	neck.Part0 = Character.Torso
	neck.Part1 = Character.Head
	neck.C0 = CFrame.new(0, 1 * size, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
	neck.C1 = CFrame.new(0, -0.5 * size, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
	neck:SetDesiredAngle(0)
	
	--Go through each child of the player character
	for _,child in pairs(Character:GetChildren()) do
		--If it's a hat or accessory, delete it
		if child:IsA("Accessory") or child:IsA("Hat") then
			child:Destroy()
		--If it's a basepart
		elseif child:IsA("BasePart") then
			--Left shoulder
			if child.Name == "Left Arm" then
				child.Size = child.Size *  size
				lshoulder.Parent = Character.Torso
				lshoulder.Part0 = Character.Torso
				lshoulder.Part1 = child
				lshoulder.C0 = CFrame.new(-1 * size, 0.5 * size, 0, -0, 0, -1, 0, 1, 0, 1, 0, -0)
				lshoulder.C1 = CFrame.new(0.5 * size, 0.5 * size, 0, -0, 0, -1, 0, 1, 0, 1, 0, -0)
				lshoulder:SetDesiredAngle(0)
			--Right shoulder
			elseif child.Name == "Right Arm" then
				child.Size = child.Size *  size
				rshoulder.Parent = Character.Torso
				rshoulder.Part0 = Character.Torso
				rshoulder.Part1 = child
				rshoulder.C0 = CFrame.new(1 * size, 0.5 * size, 0, -0, 0, 1, -0, 1, 0, -1, 0, -0)
				rshoulder.C1 = CFrame.new(-0.5 * size, 0.5 * size, 0, -0, 0, 1, 0, 1, 0, -1, 0, -0)
				rshoulder:SetDesiredAngle(0)
			--Left hip
			elseif child.Name == "Left Leg" then
				child.Size = child.Size *  size
				lhip.Parent = Character.Torso
				lhip.Part0 = Character.Torso
				lhip.Part1 = child
				lhip.C0 = CFrame.new(-1 * size, -1 * size, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
				lhip.C1 = CFrame.new(-0.5 * size, 1 * size, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
				lhip:SetDesiredAngle(0)
			--Right shoulder
			elseif child.Name == "Right Leg" then
				child.Size = child.Size *  size
				rhip.Parent = Character.Torso
				rhip.Part0 = Character.Torso
				rhip.Part1 = child
				rhip.C0 = CFrame.new(1 * size, -1 * size, 0, 0, 0, 1, -0, 1, 0, -1, 0, 0)
				rhip.C1 = CFrame.new(0.5 * size, 1 * size, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
				rhip:SetDesiredAngle(0)
			end
		end
	end
	
	Character.Animate.Disabled = false
end)
