wait()local Z=0 for e,t in pairs(root:GetConnectedParts(true))do Z=Z+t:GetMass()end local e=Instance.new("\086\101\099\116\111\114\070\111\114\099\101",root)e.Name="\071\114\097\118\105\116\121"e.Attachment0=root.RootRigAttachment e.RelativeTo=Enum.ActuatorRelativeTo.World e.ApplyAtCenterOfMass=true e.Force=(196.2*Z)*Vector3.new(0,-1,0)humanoid.StateChanged:Connect(function(Z,t)if t==Enum.HumanoidStateType.Dead or t==Enum.HumanoidStateType.Physics then e.Enabled=false else e.Enabled=true end end)
-- TODO: Re-enable once appearance checking works
--print(game.Players.LocalPlayer:HasAppearanceLoaded())
--game:GetService("Players").LocalPlayer.CharacterAppearanceLoaded:wait()
wait()

local mass = 0
for _, v in pairs(root:GetConnectedParts(true)) do
	mass = mass + v:GetMass()
end

local vectorForce = Instance.new("VectorForce", root)
vectorForce.Name = "Gravity"
vectorForce.Attachment0 = root.RootRigAttachment
vectorForce.RelativeTo = Enum.ActuatorRelativeTo.World
vectorForce.ApplyAtCenterOfMass = true
vectorForce.Force = 196.2 * mass * Vector3.new(0, -1, 0)

humanoid.StateChanged:Connect(function(old, new)
	if new == Enum.HumanoidStateType.Dead or new == Enum.HumanoidStateType.Physics then
		vectorForce.Enabled = false
	else
		vectorForce.Enabled = true
	end
end)
