How do i correctly apply part:setnetworkowner(nil)?


Im trying to make a coin pusher on roblox, and i wanted to ask how to apply this property. It was reccomended to me because the part that pushes the coins uses a constraint, and i was told this could easily be exploited, so the solution is to give physics ownership to the server.
Both the pushing part and the coins are unanchored, and i was told I need to apply part:setnetworkowner(nil) to every unanchored part.
Do I need to apply a script to every single unanchored part or not? If not, how do I apply this property?

Thank you

Well, in order to set the networkownership of the parts to the server, just do


but if you have multiple parts, you can easly loop through them like so:

for _, part in coinsPusher:GetDescendants() do
     if part:IsA("BasePart") then

You can read more about it here: Network Ownership (