In this study, the multi-element doped carbon nanospheres with core-shell structure (N,P,S-PCNs) have been successfully synthesized through the carbonization of hyper-cross-linked polystyrene nanospheres (HPSs) encapsulated with poly(cyclotriphosphazene-co-4,4’-sulfonyldiphenol) (PZS). The phosphonitrilic chloride trimer can in-situ assemble on HPSs surface, forming a poly(phosphonitrilic chloride trimer) film via sulfonyldiphenol as cross-linking agent to obtain HPSs@PZS. Subsequently, the HPSs@PZS undergoes high-temperature calcination under N2 atmosphere, and PZS with a well-preserved encapsulation capability efficiently incorporated N, P and S into carbon nanospheres to gain multi-element (N,P,S) co-doped carbon nanospheres (N,P,S-PCNs) with core-shell structure. The prepared N,P,S-PCNs exhibit exceptional dispersibility and stability as lubricant additives, effectively mitigating friction (reduced to 0.106) and wear (decreased by 84.0 %). The lubrication performance of N,P,S-PCNs is exceptional due to the nanospheres' remarkable ability to enter the gaps between friction pairs and form a deposition film on the surfaces. Moreover, the nanospheres can undergo a chemical reaction with the matrix surface, resulting in the formation of a chemical protective film. The composite protective film (deposition film and chemical protective film) significantly enhances the lubricants' ability to reduce friction and resist wear.