What is :SetNetworkOwner()?

Hello.
I see in the most of this script (that is not my!)
There is

SetNetworkOwner()

But I don’t know what is it doing.
So I decided to ask you!

9 Likes

Instead of asking us, ask the Developer Hub.

Here’s a great article to explain Network Ownership to you in around 10 minutes:

6 Likes

In Roblox, physics are simulated either on the server or on your computer. Calling SetNetworkOwner() with no arguments (nothing in () brackets) will force the server to simulate physics of the part. Otherwise, if there is a player instance in () brackets (game.Players.EsplishData for example), computer of that player will simulate physics of that part. If the function is never used, ownership will change automatically, which sometimes causes replication problems.

tl;dr

workspace.Part:SetNetworkOwner() --SERVER will ALWAYS simulate physics of a part
workspace.Part:SetNetworkOwner(game.Players.EsplishData) --YOUR computer will ALWAYS simulate physics of a part
11 Likes

Would it seem much usual to use Player.Character or just singularly player?

i talk about SetNetworkOwner in this video

and this video

maybe it might help you understand what it does

18 Likes